Shell Script to schedule a restart ...

Shell Script to schedule a restart for your zyxel router?

Follow these steps:

  • 1. Create an executable file containing this one-line command

    (sleep 8; echo mypassword; sleep 8; echo "sys reboot"; sleep 3; echo "exit") | telnet router_ip
  • 2. get your fiel scritp executable

    chmod 777 /home/augusto/scripts/reset_my_router.sh
  • 3. Set your crontab as per your schedule needs:

    augusto@george:~$ crontab -e

    paste this command

    0,10,20,30,40,50 * * * * /home/augusto/scripts/reset_my_router.sh

    in the example above, we will have the reset_my_router.sh script called every 10 minutes
  • 4. Wait and see
Syndicate content