From 8e9b9e45e415c6cd9c35acf53600a2dfcd9c8a9c Mon Sep 17 00:00:00 2001 From: Jamie Cameron Date: Tue, 24 Apr 2007 04:29:39 +0000 Subject: [PATCH] Moved reboot and shutdown command calls to functions --- init/init-lib.pl | 10 ++++++++++ init/reboot.cgi | 2 +- init/shutdown.cgi | 2 +- 3 files changed, 12 insertions(+), 2 deletions(-) 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 {