Project

General

Profile

Download (1.53 KB) Statistics
| Branch: | Tag: | Revision:
1 cb7d18d5 Renato Botelho
#!/usr/local/bin/php-cgi -f
2 97a741af Scott Ullrich
<?php
3
/*
4 ac24dc24 Renato Botelho
 * rc.initial.halt
5
 *
6
 * part of pfSense (https://www.pfsense.org)
7 c5d81585 Renato Botelho
 * Copyright (c) 2004 Bachman Kharazmi
8 38809d47 Renato Botelho do Couto
 * Copyright (c) 2004-2013 BSD Perimeter
9
 * Copyright (c) 2013-2016 Electric Sheep Fencing
10 8f585441 Luiz Souza
 * Copyright (c) 2014-2021 Rubicon Communications, LLC (Netgate)
11 ac24dc24 Renato Botelho
 * All rights reserved.
12
 *
13
 * originally part of m0n0wall (http://m0n0.ch/wall)
14 c5d81585 Renato Botelho
 * Copyright (c) 2003-2004 Manuel Kasper <mk@neon1.net>.
15 ac24dc24 Renato Botelho
 * All rights reserved.
16
 *
17 b12ea3fb Renato Botelho
 * Licensed under the Apache License, Version 2.0 (the "License");
18
 * you may not use this file except in compliance with the License.
19
 * You may obtain a copy of the License at
20 ac24dc24 Renato Botelho
 *
21 b12ea3fb Renato Botelho
 * http://www.apache.org/licenses/LICENSE-2.0
22 ac24dc24 Renato Botelho
 *
23 b12ea3fb Renato Botelho
 * Unless required by applicable law or agreed to in writing, software
24
 * distributed under the License is distributed on an "AS IS" BASIS,
25
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
26
 * See the License for the specific language governing permissions and
27
 * limitations under the License.
28 ac24dc24 Renato Botelho
 */
29 97a741af Scott Ullrich
30 ac24dc24 Renato Botelho
/* parse the configuration and include all functions used below */
31
require_once("config.inc");
32
require_once("functions.inc");
33 97a741af Scott Ullrich
34 ac24dc24 Renato Botelho
$fp = fopen('php://stdin', 'r');
35 97a741af Scott Ullrich
36 573ec19d Renato Botelho do Couto
echo "\n" . sprintf(gettext("%s will shutdown and halt system. This may take a few minutes, depending on your hardware."), $g['product_label']) . "\n";
37 ac24dc24 Renato Botelho
echo gettext("Do you want to proceed [y|n]?") . " ";
38 97a741af Scott Ullrich
39 ac24dc24 Renato Botelho
if (strcasecmp(chop(fgets($fp)), "y") == 0) {
40 573ec19d Renato Botelho do Couto
	echo "\n" . sprintf(gettext("%s will shutdown and halt system now."), $g['product_label']) . "\n";
41 ac24dc24 Renato Botelho
	system_halt();
42
}
43 97a741af Scott Ullrich
44 ac24dc24 Renato Botelho
fclose($fp);
45 e173dd74 Phil Davis
46 97a741af Scott Ullrich
?>