Files
packages/net/tunneldigger-broker/files/hook-mtu-changed
Nick Hainke 8298ce8234 tunneldigger-broker: add broker for tunneldigger
In mesh communities, tunneldigger is widely used to create L2TPv3 tunnels
and mesh via them. Since the broker is typically installed on other
distributions, the openwrt broker package has not received any
maintenance in recent years [0]. I  take now care of the further maintaince
of this package. Furthermore, I consulted with the maintainers to ensure
that they were comfortable with the change [1].

This PR is just a refactoring of the already existing opkg package from
wlanslovenija. It fixes config parsing and in general the config, adapts
to the new python syntax and fixes dependency handling.

- [0] https://github.com/wlanslovenija/firmware-packages-opkg/tree/master/net/tunneldigger-broker
- [1] https://github.com/wlanslovenija/firmware-packages-opkg/issues/24

Signed-off-by: Nick Hainke <vincent@systemli.org>
2023-06-12 14:54:58 +02:00

31 lines
746 B
Bash
Executable File

#!/bin/sh
. /lib/functions/tunneldigger.sh
TUNNEL_ID="$1"
INTERFACE="$3"
OLD_MTU="$4"
NEW_MTU="$5"
# Get the bridge interface name for the old and new MTUs.
tunneldigger_get_bridge old_bridge "${OLD_MTU}"
tunneldigger_get_bridge new_bridge "${NEW_MTU}"
if [ -z "$old_bridge" ]; then
echo "Unable to determine which bridge to use for MTU ${OLD_MTU}."
exit 1
fi
if [ -z "$new_bridge" ]; then
echo "Unable to determine which bridge to use for MTU ${NEW_MTU}."
exit 1
fi
# Remove interface from old bridge.
ip link set dev ${INTERFACE} nomaster
ip link set dev ${old_bridge} mtu ${OLD_MTU}
# Change interface bridge and MTU.
ip link set dev ${INTERFACE} master ${new_bridge} mtu ${NEW_MTU}
ip link set dev ${new_bridge} mtu ${NEW_MTU}