Commit 5a6f5b64 authored by Ad Schellevis's avatar Ad Schellevis

(ipsec) restart should stop/start the service in stead of trying an apply again.

The current issue is you can't actually restart ipsec without disabling and enabling the service, which is odd and confusing.

Convert actions to configd template and change service registration.
parent 6d2c81d7
......@@ -49,9 +49,11 @@ function if_ipsec_services()
$pconfig['name'] = 'ipsec';
$pconfig['description'] = gettext('IPsec VPN');
$pconfig['pidfile'] = '/var/run/charon.pid';
$pconfig['php']['restart'] = array('ipsec_force_reload');
$pconfig['php']['start'] = array('ipsec_force_reload');
$pconfig['mwexec']['stop'] = array('/usr/local/sbin/ipsec stop');
$pconfig['configd'] = array(
'restart' => array('ipsec restart'),
'start' => array('ipsec start'),
'stop' => array('ipsec stop'),
);
$services[] = $pconfig;
}
......
......@@ -10,7 +10,6 @@ parameters:
type:script_output
message:IPsec list ip address pools
[connect]
command:/usr/local/opnsense/scripts/ipsec/connect.py
parameters:%s
......@@ -22,3 +21,21 @@ command:/usr/local/opnsense/scripts/ipsec/disconnect.py
parameters:%s
type=script
message:IPsec disconnect %s
[start]
command:/usr/local/sbin/ipsec start
parameters:
type=script
message:IPsec service start
[stop]
command:/usr/local/sbin/ipsec stop
parameters:
type=script
message:IPsec service stop
[restart]
command:/usr/local/sbin/ipsec restart
parameters:
type=script
message:IPsec service restart
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