├── README.md └── rebootHitronRouter.sh /README.md: -------------------------------------------------------------------------------- 1 | # rebootHitronRouter 2 | 3 | Description 4 | =========== 5 | Using this script you can reboot your Hitron CGN3 router via command line. 6 | Rogers in Canada sold this router as Rogers Rocket CGN3 cable modem/router. 7 | 8 | How to use 9 | ========== 10 | You need cURL and bash. Edit the script if you have a non-default router IP, 11 | username or password. Just execute the script and the router should reboot. 12 | 13 | Motivation 14 | ========== 15 | Even after several software upgrades this routers keeps crapping. The symptoms 16 | are very high packet loss and the connection seems slow. 17 | A simple reboot always fixes the problem for me. I just run this script via 18 | cron every night to refresh the router daily. 19 | -------------------------------------------------------------------------------- /rebootHitronRouter.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # reboot a Hitron CGN3 router 4 | # Also called Rogers Rocket CGN3 Modem 5 | # Tested with CGN3ACSMR Hardware Revision A1 and Software Revision 4.5.8.27 6 | # 7 | # by https://github.com/stuffo/ 8 | # 9 | 10 | router_ip="192.168.100.1" # your router IP 11 | username="cusadmin" # username of admin user 12 | password="password" # default password, you may have changed this 13 | 14 | login_ret=$(curl -s -i -d "user=$username" -d "pws=$password" http://$router_ip/goform/login | grep 'userid=' | cut -f2 -d=|cut -f1 -d';') 15 | if [ -n "$login_ret" ] ; then 16 | echo "Logged in. Userid: $login_ret" 17 | reboot_ret=$(curl -i -s -b "userid=$login_ret;" -d 'model={"reboot":"1"}' http://$router_ip/goform/Reboot | head -1) 18 | if [ "$reboot_ret" == "HTTP/1.1 200 OK" ] ; then 19 | echo "reboot succeeded" 20 | exit 0 21 | else 22 | echo "reboot failed: $reboot_ret" 23 | fi 24 | else 25 | echo "Failed to login" 26 | fi 27 | 28 | exit 1 29 | 30 | --------------------------------------------------------------------------------