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