"") return true; return false; } function restart_service_if_running($service) { global $config; if(is_service_running($service)) restart_service($service); return; } function is_service_running($service, $ps = "") { global $config; /* if(!$ps) { exec("/bin/ps ax | awk '{ print $5 }'", $psout); } */ if(is_array($config['installedpackages']['service'])) { foreach($config['installedpackages']['service'] as $aservice) { if(strtolower($service) == strtolower($aservice['name'])) { if(!$aservice['executable']) return false; 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; } return is_process_running($aservice['executable']) ? true : false; } } } } ?>