Skip to content

Interface restart

interface restart

here

1
2
3
4
5
#!/bin/sh
r=$(/bin/date | /usr/bin/md5sum | /usr/bin/cut -c 1-8)
/sbin/uci set network.wan.hostname="owrt${r}"
/sbin/uci commit network
/etc/init.d/network reload

OR

here

IP accessibility test supposed: nc -zw1 8.8.8.8 53

#!/bin/ash
# This file is responsible for restarting the network interface.
# Should be run once OFFLINE state is detected.

INTERFACE="wwan"

# syslog entry
logger -s "INTERNET KEEP ALIVE SYSTEM: Restarting the LTE interface."

echo "SH RESTART IFACE DOWN"
ifdown $INTERFACE

sleep 2

echo "SH RESTART IFACE UP"
ifup $INTERFACE
then logread -e cron, if croned.