From: Florian Eckert Date: Thu, 9 Jul 2026 12:00:30 +0000 (+0200) Subject: strongswan: merging the swanctl and strongswan configurations block by block X-Git-Url: http://git.99rst.org/?a=commitdiff_plain;h=2236aa1bcd1d8d2a0125017995ca700b909a742f;p=openwrt-packages.git strongswan: merging the swanctl and strongswan configurations block by block In the 'prepare_env' function, the configuration setup for 'swanctl' and 'strongswan' is not grouped into blocks, so it is not clear which functions depend on each other. With this change, the 'strongswan' configuration is set up first, followed by the 'swanctl' configuration. This commit does not change the function and is a preparatory commit. Signed-off-by: Florian Eckert --- diff --git a/net/strongswan/files/swanctl.init b/net/strongswan/files/swanctl.init index 59090490d..57def8809 100644 --- a/net/strongswan/files/swanctl.init +++ b/net/strongswan/files/swanctl.init @@ -652,10 +652,6 @@ config_remote() { swanctl_xappend0 "" } -do_preamble() { - swanctl_xappend0 "# generated by /etc/init.d/swanctl" -} - config_ipsec() { local conf="$1" @@ -714,15 +710,19 @@ do_postamble() { prepare_env() { mkdir -p /var/ipsec /var/swanctl - swan_reset - swanctl_reset - do_preamble - # needed by do_postamble local debug install_routes routing_tables_ignored device_list config_load ipsec + + # Generate /var/ipsec/strongswan.conf + swan_reset config_foreach config_ipsec ipsec + do_postamble + + # Generate /var/swanctl/swanctl.conf + swanctl_reset + swanctl_xappend0 "# generated by /etc/init.d/swanctl" config_foreach config_remote remote swanctl_xappend0 "# Global config" @@ -736,7 +736,6 @@ prepare_env() { config_foreach config_mschapv2_secret mschapv2_secrets swanctl_xappend0 "}" - do_postamble } reload_service() {