Skip to content

Instantly share code, notes, and snippets.

@dap
Created July 22, 2009 02:06
Show Gist options
  • Save dap/151750 to your computer and use it in GitHub Desktop.
Save dap/151750 to your computer and use it in GitHub Desktop.
En/disable DD-WRT web console
#!/bin/bash
# ddweb.sh - enable/disable DD-WRT web console access
# Darian Anthony Patrick <dap@darianpatrick.com>
#
# 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