Last active
May 28, 2022 02:46
-
-
Save binary4cat/3e4e08200cba2fd8066a3d1d0d477ff7 to your computer and use it in GitHub Desktop.
mwan3 interface auto restart
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
mwan3 interfaces | awk '{if($4 != "online" && NR > 1) print $2}' | while read line; do | |
if [[ "$line" == "WAN" ]]; then | |
echo "------ eth1" | |
ip link set eth1 down | |
ip link set eth1 up | |
elif [[ "$line" == "WAN1" ]];then | |
echo "---- veth11" | |
ip link set veth11 down | |
ip link set veth11 up | |
elif [[ "$line" == "WAN2" ]];then | |
echo "----- veth12" | |
ip link set veth12 down | |
ip link set veth12 up | |
elif [[ "$line" == "WAN3" ]];then | |
echo "---- veth13" | |
ip link set veth13 down | |
ip link set veth13 up | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment