diff --git a/init/init-lib.pl b/init/init-lib.pl index b9642e2cc..6268a1ae4 100755 --- a/init/init-lib.pl +++ b/init/init-lib.pl @@ -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; diff --git a/init/reboot.cgi b/init/reboot.cgi index c9d47edb7..296aff54c 100755 --- a/init/reboot.cgi +++ b/init/reboot.cgi @@ -11,7 +11,7 @@ print "

\n"; $ttcmd = "$config{'reboot_command'}"; if ($in{'confirm'}) { print "",&text('reboot_exec', $ttcmd),"

\n"; - &system_logged("$config{'reboot_command'} >$null_file 2>$null_file"); + &reboot_system(); &webmin_log("reboot"); } else { diff --git a/init/shutdown.cgi b/init/shutdown.cgi index ceea05c67..b8f10ae08 100755 --- a/init/shutdown.cgi +++ b/init/shutdown.cgi @@ -11,7 +11,7 @@ print "

\n"; $ttcmd = "$config{'shutdown_command'}"; if ($in{'confirm'}) { print "",&text('shutdown_exec', $ttcmd),"

\n"; - &system_logged("$config{'shutdown_command'} >$null_file 2>$null_file"); + &shutdown_system(); &webmin_log("shutdown"); } else {