#!/bin/sh export DATE="12.1.2006";SCRIPT=${0#/rom} export TITLE="Admin: WAN" . ${SCRIPT%/*}/cgi-bin-pre.sh cat<Admin: WAN EOF if [ "$REQUEST_METHOD" = "POST" ]; then read QUERY_STRING fi wan_ifname="$(nvram get wan_ifname)" if [ -z "$QUERY_STRING" ]; then #Speedups wan_proto="$(nvram get wan_proto)" wan_ports="$(nvram get $wan_ifname'ports')" cat<
WAN Protocol:
WAN IP:
WAN Netmask:
WAN Default Route:
RJ45 Connectors:
 
Permit SSH:
Permit HTTP:
Permit Ping:
 
   
EOF else eval $(echo "$QUERY_STRING"|awk -F'&' '{for(i=1;i<=NF;i++){print $i}}') DIRTY= if [ -n "$post_wan" ]; then for V in wan_proto wan_ipaddr wan_netmask wan_gateway wan_ports ff_wanssh ff_wanhttp ff_wanicmp; do eval "C=\$$V" C=$(unescape $C) test "$V" = "wan_ports" && V=$wan_ifname'ports' if [ "$C" != "$(nvram get $V)" ]; then DIRTY=1 nvram set $V="$C" fi done fi if [ -n "$DIRTY" ]; then nvram commit>/dev/null 2>&1 cat<The changed settings are committed. The settings are active after the next Restart. EOF else cat<No settings are changed. EOF fi fi . ${SCRIPT%/*}/cgi-bin-post.sh