Last active
April 9, 2017 12:28
-
-
Save gonzoooooo/2c16d23fae2ef2f12218b527b2715f5b to your computer and use it in GitHub Desktop.
WG1800HP2 を再起動するスクリプト (user と password はルータのものを入力すること)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
ROUTER_IP='xxx.xxx.xxx.xxx' | |
HTML=`curl -u user:password -v "http://${ROUTER_IP}/index.cgi/reboot_main"` | |
SESSION_ID=`echo "${HTML}" | grep SESSION_ID| head -1 | sed -e "s/.*value='\(.*\)'.*$/\1/"` | |
curl -u user:password -v -o /dev/null "http://${ROUTER_IP}/index.cgi/reboot_main_set" --data "UPDATE_BUTTON=Reboot&SESSION_ID=${SESSION_ID}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment