diff options
author | Scott Ullrich <sullrich@pfsense.org> | 2005-06-05 21:43:55 +0000 |
---|---|---|
committer | Scott Ullrich <sullrich@pfsense.org> | 2005-06-05 21:43:55 +0000 |
commit | eb90233d15b2ffab9a8b01e8772ef5490987bb71 (patch) | |
tree | 7f453bd0c4dfcb7792fa343afc5d602d68f1dafa /usr/local/www/status_services.php | |
parent | 90e3bbc0543a8b41a95ba0b59b90f52531833ada (diff) | |
download | pfsense-eb90233d15b2ffab9a8b01e8772ef5490987bb71.zip pfsense-eb90233d15b2ffab9a8b01e8772ef5490987bb71.tar.gz |
Check for service running after restarting or starting and report back to user instead of blindly thinking a service was started
Diffstat (limited to 'usr/local/www/status_services.php')
-rwxr-xr-x | usr/local/www/status_services.php | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/usr/local/www/status_services.php b/usr/local/www/status_services.php index b1b94b2..286e1c8 100755 --- a/usr/local/www/status_services.php +++ b/usr/local/www/status_services.php @@ -75,7 +75,11 @@ if($_GET['service'] <> "") if($_GET['restartservice'] == "true") { mwexec("/sbin/killall $executable_name"); mwexec("/bin/sh /usr/local/etc/rc.d/{$service}.sh"); - $savemsg = "{$package_name} has been restarted."; + $status = is_service_running($executable_name); + if($status == 1) + $savemsg = "{$package_name} has been restarted."; + else + $savemsg = "There was a error restarting {$package_name}."; } if($_GET['stopservice'] == "true") { @@ -85,7 +89,11 @@ if($_GET['stopservice'] == "true") { if($_GET['startservice'] == "true") { mwexec("/bin/sh /usr/local/etc/rc.d/{$service}.sh"); - $savemsg = "{$package_name} has been started."; + if($status == 1) + $savemsg = "{$package_name} has been started."; + else + $savemsg = "There was a error starting {$package_name}."; + } /* batch mode, allow other scripts to call this script */ |