Commit 4a235ca2 authored by Ad Schellevis's avatar Ad Schellevis

fix static paths in service-utils.inc

parent 1a234964
...@@ -240,21 +240,21 @@ if (!function_exists('get_service_status')) { ...@@ -240,21 +240,21 @@ if (!function_exists('get_service_status')) {
global $g; global $g;
switch ($service['name']) { switch ($service['name']) {
case "openvpn": case "openvpn":
$running = isvalidpid("{$g['varrun_path']}/openvpn_{$service['mode']}{$service['vpnid']}.pid"); $running = isvalidpid("/var/run/openvpn_{$service['mode']}{$service['vpnid']}.pid");
break; break;
case "captiveportal": case "captiveportal":
$running = isvalidpid("{$g['varrun_path']}/lighty-{$service['zone']}-CaptivePortal.pid"); $running = isvalidpid("/var/run/lighty-{$service['zone']}-CaptivePortal.pid");
if (isset($config['captiveportal'][$service['zone']]['httpslogin'])) if (isset($config['captiveportal'][$service['zone']]['httpslogin']))
$running = $running && isvalidpid("{$g['varrun_path']}/lighty-{$service['zone']}-CaptivePortal-SSL.pid"); $running = $running && isvalidpid("/var/run/lighty-{$service['zone']}-CaptivePortal-SSL.pid");
break; break;
case "vhosts-http": case "vhosts-http":
$running = isvalidpid("{$g['varrun_path']}/vhosts-http.pid"); $running = isvalidpid("/var/run/vhosts-http.pid");
break; break;
case "dhcrelay6": case "dhcrelay6":
$running = isvalidpid("{$g['varrun_path']}/dhcrelay6.pid"); $running = isvalidpid("/var/run/dhcrelay6.pid");
break; break;
case 'ipsec': case 'ipsec':
$running = isvalidpid("{$g['varrun_path']}/charon.pid"); $running = isvalidpid("/var/run/charon.pid");
break; break;
default: default:
$running = is_process_running($service['name']); $running = is_process_running($service['name']);
...@@ -410,21 +410,21 @@ if (!function_exists('service_control_stop')) { ...@@ -410,21 +410,21 @@ if (!function_exists('service_control_stop')) {
global $g; global $g;
switch($name) { switch($name) {
case 'radvd': case 'radvd':
killbypid("{$g['varrun_path']}/radvd.pid"); killbypid("/var/run/radvd.pid");
break; break;
case 'captiveportal': case 'captiveportal':
$zone = htmlspecialchars($extras['zone']); $zone = htmlspecialchars($extras['zone']);
killbypid("{$g['varrun_path']}/lighty-{$zone}-CaptivePortal.pid"); killbypid("/var/run/lighty-{$zone}-CaptivePortal.pid");
killbypid("{$g['varrun_path']}/lighty-{$zone}-CaptivePortal-SSL.pid"); killbypid("/var/run/lighty-{$zone}-CaptivePortal-SSL.pid");
break; break;
case 'ntpd': case 'ntpd':
killbyname("ntpd"); killbyname("ntpd");
break; break;
case 'apinger': case 'apinger':
killbypid("{$g['varrun_path']}/apinger.pid"); killbypid("/var/run/apinger.pid");
break; break;
case 'bsnmpd': case 'bsnmpd':
killbypid("{$g['varrun_path']}/snmpd.pid"); killbypid("/var/run/snmpd.pid");
break; break;
case 'choparp': case 'choparp':
killbyname("choparp"); killbyname("choparp");
...@@ -433,16 +433,16 @@ if (!function_exists('service_control_stop')) { ...@@ -433,16 +433,16 @@ if (!function_exists('service_control_stop')) {
killbyname("dhcpd"); killbyname("dhcpd");
break; break;
case 'dhcrelay': case 'dhcrelay':
killbypid("{$g['varrun_path']}/dhcrelay.pid"); killbypid("/var/run/dhcrelay.pid");
break; break;
case 'dhcrelay6': case 'dhcrelay6':
killbypid("{$g['varrun_path']}/dhcrelay6.pid"); killbypid("/var/run/dhcrelay6.pid");
break; break;
case 'dnsmasq': case 'dnsmasq':
killbypid("{$g['varrun_path']}/dnsmasq.pid"); killbypid("/var/run/dnsmasq.pid");
break; break;
case 'unbound': case 'unbound':
killbypid("{$g['varrun_path']}/unbound.pid"); killbypid("/var/run/unbound.pid");
break; break;
case 'igmpproxy': case 'igmpproxy':
killbyname("igmpproxy"); killbyname("igmpproxy");
...@@ -460,7 +460,7 @@ if (!function_exists('service_control_stop')) { ...@@ -460,7 +460,7 @@ if (!function_exists('service_control_stop')) {
$vpnmode = htmlspecialchars($extras['vpnmode']); $vpnmode = htmlspecialchars($extras['vpnmode']);
if (($vpnmode == "server") or ($vpnmode == "client")) { if (($vpnmode == "server") or ($vpnmode == "client")) {
$id = htmlspecialchars($extras['id']); $id = htmlspecialchars($extras['id']);
$pidfile = "{$g['varrun_path']}/openvpn_{$vpnmode}{$id}.pid"; $pidfile = "/var/run/openvpn_{$vpnmode}{$id}.pid";
killbypid($pidfile); killbypid($pidfile);
} }
break; break;
...@@ -493,7 +493,7 @@ if (!function_exists('service_control_restart')) { ...@@ -493,7 +493,7 @@ if (!function_exists('service_control_restart')) {
system_ntp_configure(); system_ntp_configure();
break; break;
case 'apinger': case 'apinger':
killbypid("{$g['varrun_path']}/apinger.pid"); killbypid("/var/run/apinger.pid");
setup_gateways_monitor(); setup_gateways_monitor();
break; break;
case 'bsnmpd': case 'bsnmpd':
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment