]> git.99rst.org Git - openwrt-packages.git/commitdiff
strongswan: move strongswan syslog generation into subfunction
authorFlorian Eckert <redacted>
Fri, 10 Jul 2026 11:08:28 +0000 (13:08 +0200)
committerPhilip Prindeville <redacted>
Thu, 16 Jul 2026 20:27:36 +0000 (14:27 -0600)
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 <redacted>
net/strongswan/files/swanctl.init

index dd30f340ffd5b8cbfea44ff43f8310510658c075..13a7a1278d6e265f95bfb0a43436cd48ea772883 100644 (file)
@@ -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 "}"
 }
 
git clone https://git.99rst.org/PROJECT