From: Florian Eckert Date: Fri, 10 Jul 2026 11:08:28 +0000 (+0200) Subject: strongswan: move strongswan syslog generation into subfunction X-Git-Url: http://git.99rst.org/?a=commitdiff_plain;h=a30421aad156c2cb3592f119c620acaea5ff4b18;p=openwrt-packages.git strongswan: move strongswan syslog generation into subfunction This makes the generation process clearer and more extensible. 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 dd30f340f..13a7a1278 100644 --- a/net/strongswan/files/swanctl.init +++ b/net/strongswan/files/swanctl.init @@ -652,6 +652,21 @@ config_remote() { swanctl_xappend0 "" } +config_charon_syslog() { + local conf="$1" + local plugin="$2" + + local debug + + config_get debug "$conf" debug 0 + swan_xappend1 "syslog {" + swan_xappend2 "identifier = ipsec" + swan_xappend2 "daemon {" + swan_xappend3 "default = $debug" + swan_xappend2 "}" + swan_xappend1 "}" +} + config_charon_scripts() { local conf="$1" @@ -713,21 +728,12 @@ config_charon_install_routes() { config_strongswan_generate() { local conf="$1" - local debug - - config_get debug "$conf" debug 0 - swan_xappend0 "charon {" config_charon_install_routes "$conf" config_charon_ignore_routing_tables "$conf" config_charon_interfaces_use "$conf" config_charon_scripts "$conf" - swan_xappend1 "syslog {" - swan_xappend2 "identifier = ipsec" - swan_xappend2 "daemon {" - swan_xappend3 "default = $debug" - swan_xappend2 "}" - swan_xappend1 "}" + config_charon_syslog "$conf" "syslog" swan_xappend0 "}" }