diff options
Diffstat (limited to 'dist')
-rwxr-xr-x | dist/procd/wgconfd | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/dist/procd/wgconfd b/dist/procd/wgconfd index 41718c5..91e0e55 100755 --- a/dist/procd/wgconfd +++ b/dist/procd/wgconfd @@ -27,6 +27,8 @@ handle_interface() { config_list_foreach "$1" source handle_source + config_list_foreach "$1" peer handle_peer + procd_set_param respawn 30 5 5 procd_set_param stderr 1 procd_close_instance @@ -52,6 +54,17 @@ handle_source_arg() { procd_append_param command "$2" "$1" } +handle_peer() { + local val + procd_append_param command peer "$1" + + config_get val "$1" psk + [ -n "$val" ] && procd_append_param command psk "$val" + + config_get val "$1" source + [ -n "$val" ] && procd_append_param command source "$val" +} + start_service() { config_load wgconfd config_foreach handle_interface interface |