diff options
author | Eirik Oeverby <ltning@anduin.net> | 2009-03-11 23:05:55 +0100 |
---|---|---|
committer | Eirik Oeverby <ltning@anduin.net> | 2009-03-11 23:05:55 +0100 |
commit | c2d49311e247861b1b01509bb4342284543268fb (patch) | |
tree | 46cf89a93313bbf18f871f88f9e721514e72de98 /etc | |
parent | 3dfa6a5214276556ce089a17e597ac4a345fe319 (diff) | |
download | pfsense-c2d49311e247861b1b01509bb4342284543268fb.zip pfsense-c2d49311e247861b1b01509bb4342284543268fb.tar.gz |
Added custom_php_service_status_command support for packages.
Package authors can define a
custom_php_service_status_command
block in their package XML. Such block should only contain function
calls, and the first should be one to include their function library
file if necessary, as this is not done by service-utils.inc.
The return code of the last function call will be returned to the service
check.
Diffstat (limited to 'etc')
-rw-r--r-- | etc/inc/service-utils.inc | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/etc/inc/service-utils.inc b/etc/inc/service-utils.inc index 8c59dc2..3b1cfa5 100644 --- a/etc/inc/service-utils.inc +++ b/etc/inc/service-utils.inc @@ -172,6 +172,13 @@ function is_service_running($service, $ps = "") { if(is_array($config['installedpackages']['service'])) { foreach($config['installedpackages']['service'] as $aservice) { if(strtolower($service) == strtolower($aservice['name'])) { + if($aservice['custom_php_service_status_command'] <> "") { + $_cmd=explode(';', $aservice['custom_php_service_status_command']); + foreach($_cmd as $_acmd) { + if($_acmd) eval('$rc='.$_acmd.';'); + } + return $rc; + } if(!$aservice['executable']) return false; /* if(count(preg_grep("/{$aservice['executable']}/i", $ps))) { @@ -186,4 +193,4 @@ function is_service_running($service, $ps = "") { } } -?>
\ No newline at end of file +?> |