#!/bin/sh export DATE="13.5.2010";SCRIPT=${0#/rom} export TITLE="Admin: System" . ${SCRIPT%/*}/cgi-bin-pre.sh cat<Admin: System EOF if [ "$REQUEST_METHOD" = "POST" ]; then read QUERY_STRING fi if [ -z "$QUERY_STRING" ]; then #Speedups ff_dnsmasq="$(nvram get ff_dnsmasq)" ff_mini_fo="$(nvram get ff_mini_fo)" ff_nonetmsg="$(nvram get ff_nonetmsg)" wl0_country_code="$(nvram get wl0_country_code)" ff_tz="$(nvram get ff_tz)" test -z "$ff_tz" && ff_tz="MET-1MEST-2,M3.3.0,M10.5.0" cat<
Host Name:
GPS Position:
Domain:
DNS Server: EOF if [ -x /etc/init.d/S*dnsmasq ];then cat<
Start DNS/DHCP Server:Enable  Disable EOF fi cat<
 
Use mini_fo:Enable  Disable
IPK Source:
Network start messages:Enable  Disable
Syslog Server:
 
Timezone:
Public-SSH-Key: EOF if wl country >&- 2>&-;then cat<
Country:
EOF else cat<
WLAN Module Parameters: EOF fi cat<
 
   

Tip: To ensure a convenient network access, you should enter the Host Name (a single name without dots) and the internal Domain (multiple names separated by dots). Example: If you set Host Name to "mywrt" and Domain to "mynet.freifunk.net", it should be possible to call up the pages of this device with http://mywrt.mynet.freifunk.net/ as well as with http://mywrt/.

EOF else IFS=\&;set ${QUERY_STRING%%[^%&=+-:@-_a-z~]*};unset IFS;eval $* DIRTY= if [ -n "$post_system" ]; then ff_reset=$(nvram get ff_reset) old_mini_fo=$(nvram get ff_mini_fo) if [ "0" != "$old_mini_fo" ] && [ "0" = "$ff_mini_fo" ]; then ff_reset=format elif [ "0" = "$old_mini_fo" ] && [ "0" != "$ff_mini_fo" ]; then ff_reset=format fi wl country >&- 2>&- && add="wl0_country_code" || add="ff_ath_param" test -x /etc/init.d/S*dnsmasq && add="$add ff_dnsmasq" wan_hostname=$(echo $wan_hostname|sed -e "s/[^a-z0-9A-Z\-]/_/g") for V in $add wan_dns wan_hostname ff_adm_latlon wan_domain ff_mini_fo ff_reset ff_nonetmsg ff_ipkg ff_syslog ff_tz ff_pubkey; do eval "C=\$$V" C=$(httpd -d "$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