#!/bin/bash
if test "a$1" == a; then lynx -source -auth=admin:$(cat /etc/netgear-password) http://192.168.0.1/RgDmzHost.asp|grep NgtrDmzHostIP3|sed -e 's/.*value=//' -e 's/[^0-9].*//'
else (if lynx -source -auth=admin:$(cat /etc/netgear-password) http://192.168.0.1/RgDmzHost.asp|grep cbWanBlocking.*CHECKED >/dev/null; then echo -n 'cbWanBlocking=1&'; fi; echo "NgtrDmzHostIP3=$1") | lynx -source -post-data -auth=admin:"$(cat /etc/netgear-password)" http://192.168.0.1/goform/RgDmzHost >/dev/null
fi
