"") 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(is_array($config['installedpackages']['service'])) { foreach($config['installedpackages']['service'] as $aservice) { if(strtolower($service) == strtolower($aservice['name'])) { if ($aservice['custom_php_service_status_command'] <> "") { eval("\$rc={$aservice['custom_php_service_status_command']};"); return $rc; } if(empty($aservice['executable'])) return false; if (is_process_running($aservice['executable'])) return true; return false; } } } if (is_process_running($service)) return true; return false; } ?>