rc: rework reboot

see previous
This commit is contained in:
Franco Fichtner 2014-12-28 20:26:49 +01:00
parent c8cbd8471c
commit 960f096896

View File

@ -2,8 +2,6 @@
<?php
/*
part of m0n0wall (http://m0n0.ch/wall)
Copyright (C) 2003-2004 Manuel Kasper <mk@neon1.net>.
All rights reserved.
@ -29,32 +27,20 @@
POSSIBILITY OF SUCH DAMAGE.
*/
/* parse the configuration and include all functions used below */
require_once("config.inc");
require_once("functions.inc");
require_once("filter.inc");
require_once("captiveportal.inc");
require_once('config.inc');
require_once('functions.inc');
require_once('filter.inc');
require_once('captiveportal.inc');
$fp = fopen('php://stdin', 'r');
$fp = fopen('php://stdin', 'r');
echo <<<EOD
echo "\n{$g['product_name']} will reboot.\n";
echo "This may take a minute, depending on your hardware.\n";
echo "\nDo you want to proceed [y|n]? ";
{$g['product_name']} will reboot. This may take a few minutes, depending on your hardware.
if (strcasecmp(chop(fgets($fp)), 'y') == 0) {
echo "\n{$g['product_name']} is rebooting now.\n\n";
system_reboot_sync();
}
Do you want to proceed [y|n]?
EOD;
if (strcasecmp(chop(fgets($fp)), "y") == 0) {
echo <<<EOD
{$g['product_name']} is rebooting now.
EOD;
system_reboot_sync();
}
fclose($fp);
?>
fclose($fp);