Project

General

Profile

Download (1.44 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 81299b5c Renato Botelho
 * Copyright (c) 2004-2016 Rubicon Communications, LLC (Netgate)
9 ac24dc24 Renato Botelho
 * All rights reserved.
10
 *
11
 * originally part of m0n0wall (http://m0n0.ch/wall)
12 c5d81585 Renato Botelho
 * Copyright (c) 2003-2004 Manuel Kasper <mk@neon1.net>.
13 ac24dc24 Renato Botelho
 * All rights reserved.
14
 *
15 b12ea3fb Renato Botelho
 * Licensed under the Apache License, Version 2.0 (the "License");
16
 * you may not use this file except in compliance with the License.
17
 * You may obtain a copy of the License at
18 ac24dc24 Renato Botelho
 *
19 b12ea3fb Renato Botelho
 * http://www.apache.org/licenses/LICENSE-2.0
20 ac24dc24 Renato Botelho
 *
21 b12ea3fb Renato Botelho
 * Unless required by applicable law or agreed to in writing, software
22
 * distributed under the License is distributed on an "AS IS" BASIS,
23
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
24
 * See the License for the specific language governing permissions and
25
 * limitations under the License.
26 ac24dc24 Renato Botelho
 */
27 97a741af Scott Ullrich
28 ac24dc24 Renato Botelho
/* parse the configuration and include all functions used below */
29
require_once("config.inc");
30
require_once("functions.inc");
31 97a741af Scott Ullrich
32 ac24dc24 Renato Botelho
$fp = fopen('php://stdin', 'r');
33 97a741af Scott Ullrich
34 ac24dc24 Renato Botelho
echo "\n" . sprintf(gettext("%s will shutdown and halt system. This may take a few minutes, depending on your hardware."), $g['product_name']) . "\n";
35
echo gettext("Do you want to proceed [y|n]?") . " ";
36 97a741af Scott Ullrich
37 ac24dc24 Renato Botelho
if (strcasecmp(chop(fgets($fp)), "y") == 0) {
38
	echo "\n" . sprintf(gettext("%s will shutdown and halt system now."), $g['product_name']) . "\n";
39
	system_halt();
40
}
41 97a741af Scott Ullrich
42 ac24dc24 Renato Botelho
fclose($fp);
43 e173dd74 Phil Davis
44 97a741af Scott Ullrich
?>