Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- # This software comes without any kind of warranty or license, use it at your own risk.
- #
- # Author: Andrea Galloni
- # E-mail: andreagalloni92[at]gmail{dot}com
- #
- # Works on TP-Link 300M Wireless N ADSL2+ Modem Router TD-W8960N
- # Firmware Version: 1.3.6 Build 100825 Rel.68770n
- #
- # Parameters setup
- username='username'
- password='password'
- uri_containing_sessionKey='192.168.1.1/resetrouter.html'
- baseURI='192.168.1.1/rebootinfo.cgi?'
- # takes the sessionKey from the router rebooting web page (192.168.1.1/resetrouter.html)
- sessionKey=$(curl -ks --user $username:$password $uri_containing_sessionKey | awk '/sessionKey/{ match($3, /[0-9]+/); print substr($3, RSTART, RLENGTH); exit}')
- echo $sessionKey
- echo 'REBOOTING'
- # performs the get request to reboot the router and flush away the output
- curl -ks --user $username:$password $baseURI$sessionKey > /dev/null
- echo 'REBOOTED'
Add Comment
Please, Sign In to add comment