diff --git a/net/strongswan/files/swanctl.init b/net/strongswan/files/swanctl.init index b7af78446..3af15f19e 100644 --- a/net/strongswan/files/swanctl.init +++ b/net/strongswan/files/swanctl.init @@ -63,9 +63,12 @@ file_reset() { xappend() { local file="$1" - shift + local indent="$2" + shift 2 - echo "$@" >> "$file" + for cmd in "$@"; do + echo "$indent$cmd" >> "$file" + done } swan_reset() { @@ -77,23 +80,23 @@ swan_xappend() { } swan_xappend0() { - swan_xappend "$@" + swan_xappend "" "$@" } swan_xappend1() { - swan_xappend " ""$@" + swan_xappend " " "$@" } swan_xappend2() { - swan_xappend " ""$@" + swan_xappend " " "$@" } swan_xappend3() { - swan_xappend " ""$@" + swan_xappend " " "$@" } swan_xappend4() { - swan_xappend " ""$@" + swan_xappend " " "$@" } swanctl_reset() { @@ -105,23 +108,23 @@ swanctl_xappend() { } swanctl_xappend0() { - swanctl_xappend "$@" + swanctl_xappend "" "$@" } swanctl_xappend1() { - swanctl_xappend " ""$@" + swanctl_xappend " " "$@" } swanctl_xappend2() { - swanctl_xappend " ""$@" + swanctl_xappend " " "$@" } swanctl_xappend3() { - swanctl_xappend " ""$@" + swanctl_xappend " " "$@" } swanctl_xappend4() { - swanctl_xappend " ""$@" + swanctl_xappend " " "$@" } warning() { @@ -335,7 +338,7 @@ config_child() { [ $ipcomp -eq 1 ] && swanctl_xappend4 "ipcomp = 1" [ -n "$interface" ] && swanctl_xappend4 "interface = $interface" [ -n "$priority" ] && swanctl_xappend4 "priority = $priority" - [ -n "$if_id" ] && { swanctl_xappend4 "if_id_in = $if_id" ; swanctl_xappend4 "if_id_out = $if_id" ; } + [ -n "$if_id" ] && swanctl_xappend4 "if_id_in = $if_id" "if_id_out = $if_id" [ -n "$startaction" -a "$startaction" != "none" ] && swanctl_xappend4 "start_action = $startaction" [ -n "$closeaction" -a "$closeaction" != "none" ] && swanctl_xappend4 "close_action = $closeaction" swanctl_xappend4 "esp_proposals = $esp_proposal"