Created
July 22, 2009 02:06
-
-
Save dap/151750 to your computer and use it in GitHub Desktop.
En/disable DD-WRT web console
This file contains hidden or 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 | |
# ddweb.sh - enable/disable DD-WRT web console access | |
# Darian Anthony Patrick <[email protected]> | |
# | |
# Control access to the web management console | |
# of devices using the DD-WRT firmware by | |
# enabling/disabling the HTTP & HTTPS access. | |
# | |
# Repository: http://gist.github.com/151750 | |
DDHOST="$2" | |
case "$1" in | |
enable) | |
ssh $DDHOST "nvram set http_enable=1; | |
nvram set https_enable=1; | |
nvram commit; reboot" | |
;; | |
disable) | |
ssh $DDHOST "nvram set http_enable=0; | |
nvram set https_enable=0; | |
nvram commit; reboot" | |
;; | |
*) | |
echo "Usage: $0 {enable|disable} hostname" >&2 | |
exit 1 | |
;; | |
esac | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment