Moved reboot and shutdown command calls to functions

This commit is contained in:
Jamie Cameron
2007-04-24 04:29:39 +00:00
parent 411b129287
commit 8e9b9e45e4
3 changed files with 12 additions and 2 deletions

View File

@@ -1116,5 +1116,15 @@ foreach my $f (split(/\s+/, $config{'rc_conf'})) {
}
}
sub reboot_system
{
&system_logged("$config{'reboot_command'} >$null_file 2>$null_file");
}
sub shutdown_system
{
&system_logged("$config{'shutdown_command'} >$null_file 2>$null_file");
}
1;

View File

@@ -11,7 +11,7 @@ print "<p>\n";
$ttcmd = "<tt>$config{'reboot_command'}</tt>";
if ($in{'confirm'}) {
print "<font size=+1>",&text('reboot_exec', $ttcmd),"</font><p>\n";
&system_logged("$config{'reboot_command'} >$null_file 2>$null_file");
&reboot_system();
&webmin_log("reboot");
}
else {

View File

@@ -11,7 +11,7 @@ print "<p>\n";
$ttcmd = "<tt>$config{'shutdown_command'}</tt>";
if ($in{'confirm'}) {
print "<font size=+1>",&text('shutdown_exec', $ttcmd),"</font><p>\n";
&system_logged("$config{'shutdown_command'} >$null_file 2>$null_file");
&shutdown_system();
&webmin_log("shutdown");
}
else {