Help Needed, Periodically check of internet and reboot if needed

wget -U "" -O - "https://openwrt.org/\
_export/code/docs/guide-user/network/\
wan/multiwan/mwan_netifd?codeblock=0" \
| sed -n -e "/^iface_check()\s{$/,/^}$/p" \
> /root/iface-check.sh
cat << "EOF" >> /root/iface-check.sh
. /lib/functions/network.sh
network_flush_cache
for IPV in 4 6
do
eval network_find_wan"${IPV%4}" NET_IF
if ! iface_check "${NET_IF}" 3 3
then logger -t netifd-watchdog \
"${NET_IF} is not responding - restarting"
ifup "${NET_IF}"
fi
done
EOF
2 Likes