What's new
  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

Script for rebooting router if internet disconnect

SebZab

Regular Contributor
I have got internet LTE from usb stick working in NDIS mode with cdc_ncm driver.
Sometimes router lost connection with ISP and there is only one solution - hard reset.
Below is usefull script for automatic rebooting if internet is gone:

if grep 'cdc_ncm: usb0: network connection: disconnected' "/tmp/syslog.log"; then
echo "LTE OFF"
echo -n > /tmp/syslog.log
reboot
else
echo "LTE ON"
fi


You should also add running of this script in cron every 2 minutes -> */2* * * *
 
Last edited:

Latest threads

Support SNBForums w/ Amazon

If you'd like to support SNBForums, just use this link and buy anything on Amazon. Thanks!

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Back
Top