wireguard-tools: enable reload without teardown
- preserve (active) interface (at reload) 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
148207730a
commit
0a576dec74
@ -56,12 +56,10 @@ proto_wireguard_setup() {
|
||||
config_get nohostroute "${config}" "nohostroute"
|
||||
config_get tunlink "${config}" "tunlink"
|
||||
|
||||
ip link del dev "${config}" 2>/dev/null
|
||||
ip link add dev "${config}" type wireguard
|
||||
# Add the link only if it didn't already exist
|
||||
ip -br link show "${config}" >/dev/null 2>&1 || ip link add dev "${config}" type wireguard
|
||||
|
||||
if [ "${mtu}" ]; then
|
||||
ip link set mtu "${mtu}" dev "${config}"
|
||||
fi
|
||||
[ -n "${mtu}" ] && ip link set mtu "${mtu}" dev "${config}"
|
||||
|
||||
proto_init_update "${config}" 1
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user