Advertisement
Guest User

Untitled

a guest
Apr 8th, 2016
209
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.83 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. # This software comes without any kind of warranty or license, use it at your own risk.
  4. #
  5. # Author: Andrea Galloni
  6. # E-mail: andreagalloni92[at]gmail{dot}com
  7. #
  8. # Works on TP-Link 300M Wireless N ADSL2+ Modem Router TD-W8960N
  9. # Firmware Version: 1.3.6 Build 100825 Rel.68770n
  10. #
  11.  
  12. # Parameters setup
  13. username='username'
  14. password='password'
  15. uri_containing_sessionKey='192.168.1.1/resetrouter.html'
  16. baseURI='192.168.1.1/rebootinfo.cgi?'
  17.  
  18. # takes the sessionKey from the router rebooting web page (192.168.1.1/resetrouter.html)
  19. sessionKey=$(curl -ks --user $username:$password $uri_containing_sessionKey | awk '/sessionKey/{ print substr($3,2,20);exit}')
  20.  
  21. echo $sessionKey
  22. echo 'REBOOTING'
  23. # performs the get request to reboot the router and flush away the output
  24. curl -ks --user $username:$password $baseURI$sessionKey > /dev/null
  25. echo 'REBOOTED'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement