Project

General

Profile

« Previous | Next » 

Revision c44d097f

Added by Ermal LUÇI over 12 years ago

Correct syntax. Also support passing an interface as argument

View differences:

etc/rc.openvpn
52 52
$openvpnlck = lock('openvpn', LOCK_EX);
53 53
if (empty($argument) || $argument == "all")
54 54
	$interface = ""; 
55
else
55
else {
56 56
	$interface = lookup_gateway_interface_by_name($argument);
57
	if (empty($interface))
58
		$interface = $argument;
59
}
57 60

  
58 61
if(is_array($config['openvpn']['openvpn-server'])) {
59 62
	foreach($config['openvpn']['openvpn-server'] as &$server) {
60
		if ($server['interface'] == $interface || empty($interface))) {
63
		if ($server['interface'] == $interface || empty($interface))
61 64
			openvpn_resync('server', $server);
62
		}
63 65
	}
64 66
}
65 67

  
66 68
if (is_array($config['openvpn']['openvpn-client'])) {
67 69
	foreach($config['openvpn']['openvpn-client'] as &$client) {
68
		if ($client['interface'] == $interface || empty($interface))) {
70
		if ($client['interface'] == $interface || empty($interface))
69 71
			openvpn_resync('client', $client);
70
		}
71 72
	}
72 73
}
73 74

  

Also available in: Unified diff