mirror of
https://git.openwrt.org/openwrt/openwrt.git
synced 2026-02-04 12:17:43 +01:00
wireguard-tools: add protocol renew handler
- add a renew handler - add a peer detect handler ( benefits from https://github.com/openwrt/netifd/pull/66 ) Signed-off-by: Paul Donald <newtwen+github@gmail.com> Link: https://github.com/openwrt/openwrt/pull/21784 Signed-off-by: Robert Marko <robimarko@gmail.com>
This commit is contained in:
parent
d59b360cee
commit
400742a855
1 changed files with 8 additions and 0 deletions
|
|
@ -16,6 +16,9 @@ fi
|
|||
}
|
||||
|
||||
proto_wireguard_init_config() {
|
||||
renew_handler=1
|
||||
peer_detect=1
|
||||
|
||||
proto_config_add_string "private_key"
|
||||
proto_config_add_int "listen_port"
|
||||
proto_config_add_int "mtu"
|
||||
|
|
@ -203,6 +206,11 @@ proto_wireguard_setup() {
|
|||
proto_send_update "${config}"
|
||||
}
|
||||
|
||||
proto_wireguard_renew() {
|
||||
local interface="$1"
|
||||
proto_wireguard_setup "$interface"
|
||||
}
|
||||
|
||||
proto_wireguard_teardown() {
|
||||
local config="$1"
|
||||
ip link del dev "${config}" >/dev/null 2>&1
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue