Commit c8cbd847 authored by Franco Fichtner's avatar Franco Fichtner

rc: quick rework of halt

no real changes, just overall sanity
parent a1f66881
...@@ -2,10 +2,7 @@ ...@@ -2,10 +2,7 @@
<?php <?php
/* /*
part of pfSense (www.pfSense.com)
Copyright (C)2004 Bachman Kharazmi Copyright (C)2004 Bachman Kharazmi
Originally part of m0n0wall as rc.initial.reboot (http://m0n0.ch/wall)
Copyright (C) 2003-2004 Manuel Kasper <mk@neon1.net>. Copyright (C) 2003-2004 Manuel Kasper <mk@neon1.net>.
All rights reserved. All rights reserved.
...@@ -31,30 +28,18 @@ ...@@ -31,30 +28,18 @@
POSSIBILITY OF SUCH DAMAGE. POSSIBILITY OF SUCH DAMAGE.
*/ */
/* parse the configuration and include all functions used below */ require_once('config.inc');
require_once("config.inc"); require_once('functions.inc');
require_once("functions.inc");
$fp = fopen('php://stdin', 'r');
echo <<<EOD
{$g['product_name']} will shutdown and halt system. This may take a few minutes, depending on your hardware.
Do you want to proceed [y|n]?
EOD;
if (strcasecmp(chop(fgets($fp)), "y") == 0) {
echo <<<EOD $fp = fopen('php://stdin', 'r');
{$g['product_name']} will shutdown and halt system now. echo "\n{$g['product_name']} will shutdown and halt system.\n";
echo "This may take a minute, depending on your hardware.\n";
echo "\nDo you want to proceed [y|n]? ";
EOD; if (strcasecmp(chop(fgets($fp)), 'y') == 0) {
echo "\n{$g['product_name']} will shutdown and halt system now.\n";
system_halt();
}
system_halt(); fclose($fp);
}
fclose($fp);
?>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment