Browse Source

strongswan: fix reload service

Based on the ipsec running state reload_service is either reloading ipsec
or starting ipsec. However in the latter case it calls ipsec start which
bypasses the procd start_service function which means the running ipsec
instance is not managed by procd.
Fix this by calling start in case ipsec is not running; at the same time
add service_running function which is used by procd provided running
function.

Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
lilik-openwrt-22.03
Hans Dedecker 7 years ago
parent
commit
1d31d840d4
1 changed files with 10 additions and 5 deletions
  1. +10
    -5
      net/strongswan/files/ipsec.init

+ 10
- 5
net/strongswan/files/ipsec.init View File

@ -318,14 +318,19 @@ prepare_env() {
config_foreach config_remote remote config_foreach config_remote remote
} }
service_running() {
ipsec status > /dev/null 2>&1
}
reload_service() { reload_service() {
prepare_env
if ipsec status > /dev/null 2>&1; then
running && {
prepare_env
ipsec rereadall ipsec rereadall
ipsec reload ipsec reload
else
ipsec start
fi
return
}
start
} }
service_triggers() { service_triggers() {


Loading…
Cancel
Save