История изменений
Исправление dhameoelin, (текущая версия) :
Как-то так:
#!/bin/sh
#
# Скипнута шапка скрипта
#
LINK_MAIN=wan_a
LINK_FAILOVER=wan_b
if test "${ACTION}" = "ifup" && test "${INTERFACE}" = "${LINK_MAIN}"; then
logger -t MWAN3-WIREGUARD-FIX -s "${ACTION} - ${INTERFACE}"
ifdown "${LINK_FAILOVER}"
sleep 1
ifup "${LINK_FAILOVER}"
fi
Исходная версия dhameoelin, :
Как-то так:
#!/bin/sh
#
# This file is interpreted as shell script.
# Put your custom mwan3 action here, they will
# be executed with each netifd hotplug interface event
# on interfaces for which mwan3 is enabled.
#
# There are three main environment variables that are passed to this script.
#
# $ACTION
# <ifup> Is called by netifd and mwan3track
# <ifdown> Is called by netifd and mwan3track
# <connected> Is only called by mwan3track if tracking was successful
# <disconnected> Is only called by mwan3track if tracking has failed
# $INTERFACE Name of the interface which went up or down (e.g. "wan" or "wwan")
# $DEVICE Physical device name which interface went up or down (e.g. "eth0" or "wwan0")
LINK_MAIN=wan_a
LINK_FAILOVER=wan_b
if test "${ACTION}" = "ifup" && test "${INTERFACE}" = "${LINK_MAIN}"; then
logger -t MWAN3-WIREGUARD-FIX -s "${ACTION} - ${INTERFACE}"
ifdown "${LINK_FAILOVER}"
sleep 1
ifup "${LINK_FAILOVER}"
fi