diff options
Diffstat (limited to 'package/network/services/openvpn/files/openvpn.init')
-rw-r--r-- | package/network/services/openvpn/files/openvpn.init | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/package/network/services/openvpn/files/openvpn.init b/package/network/services/openvpn/files/openvpn.init index 7e6cfd9c35..ebb05640d8 100644 --- a/package/network/services/openvpn/files/openvpn.init +++ b/package/network/services/openvpn/files/openvpn.init @@ -49,6 +49,19 @@ append_params() { done } +append_list() { + local p; local v; local s="$1"; shift + + list_cb_append() { + v="$1:${v}" + } + + for p in $*; do + config_list_foreach "$s" "$p" list_cb_append + done + [ -n "$v" ] && append_param "$s" "$p" && echo " ${v%*:}" >> "/var/etc/openvpn-$s.conf" +} + section_enabled() { config_get_bool enable "$1" 'enable' 0 config_get_bool enabled "$1" 'enabled' 0 @@ -99,6 +112,7 @@ start_instance() { append_bools "$s" $OPENVPN_BOOLS append_params "$s" $OPENVPN_PARAMS + append_list "$s" $OPENVPN_LIST openvpn_add_instance "$s" "/var/etc" "openvpn-$s.conf" } |