strongswan: swanctl init script doesn't load connections
authorPhilip Prindeville <redacted>
Wed, 5 May 2021 17:40:19 +0000 (11:40 -0600)
committerPhilip Prindeville <redacted>
Wed, 5 May 2021 17:58:34 +0000 (11:58 -0600)
Fixes issue #15446

Signed-off-by: Philip Prindeville <redacted>
net/strongswan/Makefile
net/strongswan/files/swanctl.init

index a66645a70027a4f2771f25624d16d5eb3793aa1e..3ec33c6f5430274662fb9181a6f40269906915b8 100644 (file)
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=strongswan
 PKG_VERSION:=5.9.2
-PKG_RELEASE:=6
+PKG_RELEASE:=7
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
 PKG_SOURCE_URL:=https://download.strongswan.org/ https://download2.strongswan.org/
index 58f168dcf53b835e1149899e81b779bb9290f903..a1fb7c31131c8541bebc9ae7ccd53de7651d3c25 100644 (file)
@@ -517,10 +517,6 @@ config_ipsec() {
        local interface
        local device_list
 
-       swan_reset
-       swanctl_reset
-       do_preamble
-
        config_get debug "$1" debug 0
        config_get_bool rtinstall_enabled "$1" rtinstall_enabled 1
        [ $rtinstall_enabled -eq 1 ] && install_routes=yes || install_routes=no
@@ -546,7 +542,9 @@ config_ipsec() {
                done
                [ -n "$device_list" ] && WAIT_FOR_INTF=0 || WAIT_FOR_INTF=1
        fi
+}
 
+do_postamble() {
        swan_xappend0 "# generated by /etc/init.d/swanctl"
        swan_xappend0 "charon {"
        swan_xappend1 "install_routes = $install_routes"
@@ -566,9 +564,16 @@ config_ipsec() {
 
 prepare_env() {
        mkdir -p /var/ipsec /var/swanctl
+
+       swan_reset
+       swanctl_reset
+       do_preamble
+
        config_load ipsec
        config_foreach config_ipsec ipsec
        config_foreach config_remote remote
+
+       do_postamble
 }
 
 service_running() {
git clone https://git.99rst.org/PROJECT