Reboot router GL-AR300M if no internet

sometimes my router GL-AR300M with internet usb key, lose the internet connection. The solution is to restart the router. I don’t know why, may be the internet usb key is the problem.

But I need to solve the problem. I write this bash file:

if ping -c 4 -W 1 >/dev/null; then
echo “IPv4 is up”
echo “IPv4 is down”
reboot -d 60
fi is the vpn server. If no ping then restart

With cron I write: 0 * * * * sh /etc/crontabs/>>restart.log

I don’t know if the cron file si correct. Every hour it ceck the connection.
But I don’t see the restart log, so I’m afraid that it does not work.
Can someone help me?
Best regards

I solved, thank you!

Why reboot? In fact, you can use restart network instead.

Hi @suibaf - can you share your solution - looking to do the same…