1
0
Fork 0
mirror of https://github.com/Ysurac/openmptcprouter-feeds.git synced 2025-02-12 18:41:51 +00:00

MPTCP reload via hotplug only when needed

This commit is contained in:
Ycarus (Yannick Chabanois) 2024-11-28 15:49:23 +01:00
parent b9a7eeb5ee
commit 004851d2db

View file

@ -6,10 +6,10 @@
/etc/init.d/mptcp enabled || exit 0
if [ "$ACTION" = ifup -o "$ACTION" = ifupdate -o "$ACTION" = iflink ] && [ -z "$(echo $DEVICE | grep oip | grep gre)" ]; then
if [ "$ACTION" = ifupdate -o "$ACTION" = iflink ] && [ -z "$(echo $DEVICE | grep oip | grep gre)" ] && [ -n "$(uci -q get network.$INTERFACE.multipath)" ] && [ "$(uci -q get network.$INTERFACE.multipath)" != "off" ]; then
logger -t "mptcp" "Reloading mptcp config due to $ACTION of $INTERFACE ($DEVICE)"
/etc/init.d/mptcp reload "$DEVICE" >/dev/null || exit 0
elif [ "$ACTION" = ifdown ]; then
multipath $DEVICE off 2>&1 >/dev/null
multipath $DEVICE off 2>&1 >/dev/null || exit 0
fi