0
0
mirror of https://github.com/openwrt/packages.git synced 2025-03-14 15:47:34 +00:00
Nick Hainke 40b87aac95 wg-installer: use babeld add_interface function
With commit 385200443554 ("babeld: add add_interface function") babeld
has a new ubus function allowing to dynamically add an interface.

Before the add_interface function, we were required to reload babeld.
The reload influenced the babeld routing. However, the remove part is
still missing and will be added at a later stage.

Signed-off-by: Nick Hainke <vincent@systemli.org>
2022-02-01 22:32:30 +01:00

17 lines
303 B
Bash

#!/bin/sh
# check if wireguard
if [ "${DEVTYPE}" != "wireguard" ]; then
exit 0
fi
# check if correct naming
slicedint=$(echo "$INTERFACE" | cut -c1-3)
if [ "${slicedint}" != "wg_" ]; then
exit 0
fi
if [ "${ACTION}" = "add" ]; then
ubus call babeld add_interface '{"ifname":'\""$INTERFACE"\"'}'
fi