From 699125b18256a9270c28be75f8579b456f39035e Mon Sep 17 00:00:00 2001 From: jim-p Date: Mon, 11 Feb 2013 13:50:11 -0500 Subject: Use the actual openvpn restart routine when starting/stopping from services rather than killing/restarting manually. --- usr/local/www/status_services.php | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'usr/local') diff --git a/usr/local/www/status_services.php b/usr/local/www/status_services.php index 126a67a..608804f 100755 --- a/usr/local/www/status_services.php +++ b/usr/local/www/status_services.php @@ -40,6 +40,7 @@ require_once("guiconfig.inc"); require_once("captiveportal.inc"); require_once("service-utils.inc"); +require_once("openvpn.inc"); require_once("ipsec.inc"); require_once("vpn.inc"); require_once("vslb.inc"); @@ -83,12 +84,8 @@ if($_GET['mode'] == "restartservice" and !empty($_GET['service'])) { if ($vpnmode == "server" || $vpnmode == "client") { $id = $_GET['id']; $configfile = "{$g['varetc_path']}/openvpn/{$vpnmode}{$id}.conf"; - $pidfile = $g['varrun_path'] . "/openvpn_{$vpnmode}{$id}.pid"; - if (file_exists($configfile)) { - killbypid($pidfile); - sleep(1); - mwexec_bg("/usr/local/sbin/openvpn --config {$configfile}"); - } + if (file_exists($configfile)) + openvpn_restart_by_vpnid($vpnmode, $id); } break; case 'relayd': @@ -139,7 +136,7 @@ if($_GET['mode'] == "startservice" and !empty($_GET['service'])) { $id = $_GET['id']; $configfile = "{$g['varetc_path']}/openvpn/{$vpnmode}{$id}.conf"; if (file_exists($configfile)) - mwexec_bg("/usr/local/sbin/openvpn --config {$configfile}"); + openvpn_restart_by_vpnid($vpnmode, $id); } break; case 'relayd': -- cgit v1.1