diff options
author | Hristo Venev <hristo@venev.name> | 2019-09-30 14:49:13 +0300 |
---|---|---|
committer | Hristo Venev <hristo@venev.name> | 2019-09-30 15:30:56 +0300 |
commit | a4ff443588ad83f668a5434257dfcbb2716d5ef8 (patch) | |
tree | da73ac30c19535a98b932192fc6c6a6900513efa /dist/procd | |
parent | 8aead91532b116f40649ae7e9c1b7d15fbd67a4f (diff) |
Document [peer], implement in procd.
Diffstat (limited to 'dist/procd')
-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 |