#!/bin/sh export DATE="6.6.2005";SCRIPT=${0#/rom} export TITLE="Admin: PPPoE" . ${SCRIPT%/*}/cgi-bin-pre.sh cat<Admin: PPPoE EOF if [ "$REQUEST_METHOD" = "POST" ]; then read QUERY_STRING fi if [ -z "$QUERY_STRING" ]; then #Speedups wan_proto="$(nvram get wan_proto)" cat<
Username:
Password:
Connect on Demand: Min. (Idle Time)
Keep Alive: Sec. (Retry Period)
 
Access Concentrator:
Service Name:
Static IP:
MTU:
 
   
EOF if [ -n "$(ifconfig ppp0 2> /dev/null)" ]; then ADDR="$(ifconfig ppp0 | awk 'sub("inet addr:*","") { print $1 }')" PEER="$(ifconfig ppp0 | awk 'sub("P-t-P:*","") { print $3 }')" cat< State: The PPPoE connection is active. The interface address is $ADDR and the peer address is $PEER.

EOF else cat< State: The PPPoE connection is not active.

EOF fi else eval $(echo "$QUERY_STRING"|awk -F'&' '{for(i=1;i<=NF;i++){print $i}}') DIRTY= if [ -n "$post_pppoecd" ]; then for V in wan_mtu ppp_passwd ppp_username ppp_demand ppp_ac ppp_idletime ppp_redialperiod ppp_ifname ppp_keepalive ppp_service ppp_static ppp_static_ip; do eval "C=\$$V" C=$(unescape $C) 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