diff options
author | jim-p <jimp@pfsense.org> | 2013-12-26 15:47:23 -0500 |
---|---|---|
committer | jim-p <jimp@pfsense.org> | 2013-12-26 15:47:23 -0500 |
commit | 7cbfc2654449b0aa6886dd11a946e4001f171141 (patch) | |
tree | a92a328fb1cea7955690dfe76bde70cce7dd39d0 /etc/phpshellsessions | |
parent | c7a3356e6bfb67b1b617eaeddd5983ddae901759 (diff) | |
download | pfsense-7cbfc2654449b0aa6886dd11a946e4001f171141.zip pfsense-7cbfc2654449b0aa6886dd11a946e4001f171141.tar.gz |
Add a "status" subcommand to the svc php shell script.
Diffstat (limited to 'etc/phpshellsessions')
-rw-r--r-- | etc/phpshellsessions/svc | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/etc/phpshellsessions/svc b/etc/phpshellsessions/svc index 5770c02..5c47507 100644 --- a/etc/phpshellsessions/svc +++ b/etc/phpshellsessions/svc @@ -66,18 +66,33 @@ switch ($svc_name) { break; } -echo "Attempting to issue {$action} to {$svc_name} service...\n"; - switch ($action) { case "restart": + echo "Attempting to issue {$action} to {$svc_name} service...\n"; $savemsg = service_control_restart($svc_name, $extras); break; case "start": + echo "Attempting to issue {$action} to {$svc_name} service...\n"; $savemsg = service_control_start($svc_name, $extras); break; case "stop": + echo "Attempting to issue {$action} to {$svc_name} service...\n"; $savemsg = service_control_stop($svc_name, $extras); break; + case "status": + switch ($svc_name) { + case "openvpn": + $service = $vpnsvc; + break; + case "captiveportal": + $service = $cpzone; + break; + default: + $service = find_service_by_name($svc_name); + break; + } + $savemsg = get_service_status($service) ? "Service {$svc_name} is running." : "Service {$svc_name} is stopped."; + break; } echo "\n{$savemsg}\n"; |