Project

General

Profile

« Previous | Next » 

Revision 699125b1

Added by Jim Pingle over 12 years ago

Use the actual openvpn restart routine when starting/stopping from services rather than killing/restarting manually.

View differences:

usr/local/www/status_services.php
40 40
require_once("guiconfig.inc");
41 41
require_once("captiveportal.inc");
42 42
require_once("service-utils.inc");
43
require_once("openvpn.inc");
43 44
require_once("ipsec.inc");
44 45
require_once("vpn.inc");
45 46
require_once("vslb.inc");
......
83 84
			if ($vpnmode == "server" || $vpnmode == "client") {
84 85
				$id = $_GET['id'];
85 86
				$configfile = "{$g['varetc_path']}/openvpn/{$vpnmode}{$id}.conf";
86
				$pidfile = $g['varrun_path'] . "/openvpn_{$vpnmode}{$id}.pid";
87
				if (file_exists($configfile)) {
88
					killbypid($pidfile);
89
					sleep(1);
90
					mwexec_bg("/usr/local/sbin/openvpn --config {$configfile}");
91
				}
87
				if (file_exists($configfile))
88
					openvpn_restart_by_vpnid($vpnmode, $id);
92 89
			}
93 90
			break;
94 91
		case 'relayd':
......
139 136
				$id = $_GET['id'];
140 137
				$configfile = "{$g['varetc_path']}/openvpn/{$vpnmode}{$id}.conf";
141 138
				if (file_exists($configfile))
142
					mwexec_bg("/usr/local/sbin/openvpn --config {$configfile}");
139
					openvpn_restart_by_vpnid($vpnmode, $id);
143 140
			}
144 141
			break;
145 142
		case 'relayd':

Also available in: Unified diff