Skip to content

Instantly share code, notes, and snippets.

@gonzoooooo
Last active April 9, 2017 12:28
Show Gist options
  • Save gonzoooooo/2c16d23fae2ef2f12218b527b2715f5b to your computer and use it in GitHub Desktop.
Save gonzoooooo/2c16d23fae2ef2f12218b527b2715f5b to your computer and use it in GitHub Desktop.
WG1800HP2 を再起動するスクリプト (user と password はルータのものを入力すること)
#!/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