From: Felix Fietkau Date: Fri, 6 Oct 2006 20:10:37 +0000 (+0000) Subject: restructure webif similar to x-wrt X-Git-Tag: whiterussian_rc6~110 X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=9e93c15a4135619a038665dd0e810fb3666fb3b4;p=openwrt%2Fsvn-archive%2Fopenwrt.git restructure webif similar to x-wrt SVN-Revision: 4938 --- diff --git a/openwrt/package/webif/files/etc/httpd.conf b/openwrt/package/webif/files/etc/httpd.conf index 29bafa926b..5197b88378 100644 --- a/openwrt/package/webif/files/etc/httpd.conf +++ b/openwrt/package/webif/files/etc/httpd.conf @@ -1,4 +1,8 @@ .asp:text/html /cgi-bin/webif:root:$p$root /cgi-bin/webif:admin:$p$root +.svg:image/svg+xml +.png:image/png +.gif:image/gif +.jpg:image/jpg diff --git a/openwrt/package/webif/files/www/cgi-bin/webif/about.sh b/openwrt/package/webif/files/www/cgi-bin/webif/about.sh index abaf27b435..0d7416a691 100755 --- a/openwrt/package/webif/files/www/cgi-bin/webif/about.sh +++ b/openwrt/package/webif/files/www/cgi-bin/webif/about.sh @@ -8,17 +8,24 @@ header "Info" "About" "@TR<>..."
@TR<modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
>>
-@TR<> © 2005 Felix Fietkau <openwrt@nbd.name>
+@TR<> © 2005-2006 OpenWrt.org

@TR<>: diff --git a/openwrt/package/webif/files/www/cgi-bin/webif/connection.sh b/openwrt/package/webif/files/www/cgi-bin/webif/connection.sh deleted file mode 100755 index cab7ebd7c1..0000000000 --- a/openwrt/package/webif/files/www/cgi-bin/webif/connection.sh +++ /dev/null @@ -1,29 +0,0 @@ -#!/usr/bin/webif-page ->" -?> - - - - - - - - - - - - - - - - - - -
@TR<>


@TR<>
&- | awk '$0 ~ /^Active UNIX/ {ignore = 1}; ignore != 1 { print $0 }' ?>
- - - diff --git a/openwrt/package/webif/files/www/cgi-bin/webif/hosts.sh b/openwrt/package/webif/files/www/cgi-bin/webif/hosts.sh deleted file mode 100755 index 22c8fe27e2..0000000000 --- a/openwrt/package/webif/files/www/cgi-bin/webif/hosts.sh +++ /dev/null @@ -1,158 +0,0 @@ -#!/usr/bin/webif-page -&- 2>&- -exists $ETHERS_FILE || touch $ETHERS_FILE >&- 2>&- - -update_hosts() { - exists /tmp/.webif/* || mkdir -p /tmp/.webif - awk -v "mode=$1" -v "ip=$2" -v "name=$3" ' -BEGIN { - FS="[ \t]" - host_added = 0 -} -{ processed = 0 } -(mode == "del") && (ip == $1) { - names_found = 0 - n = split($0, names, "[ \t]") - output = $1 " " - for (i = 2; i <= n; i++) { - if ((names[i] != "") && (names[i] != name)) { - output = output names[i] " " - names_found++ - } - } - if (names_found > 0) print output - processed = 1 -} -(mode == "add") && (ip == $1) { - print $0 " " name - host_added = 1 - processed = 1 -} -processed == 0 { - print $0 -} -END { - if ((mode == "add") && (host_added == 0)) print ip " " name -}' "$HOSTS_FILE" > /tmp/.webif/file-hosts-new - mv "/tmp/.webif/file-hosts-new" "/tmp/.webif/file-hosts" - HOSTS_FILE=/tmp/.webif/file-hosts -} - -update_ethers() { - exists /tmp/.webif/* || mkdir -p /tmp/.webif - case "$1" in - add) - grep -E -v "^[ \t]*$2" $ETHERS_FILE > /tmp/.webif/file-ethers-new - echo "$2 $3" >> /tmp/.webif/file-ethers-new - mv /tmp/.webif/file-ethers-new /tmp/.webif/file-ethers - ;; - del) - grep -E -v "^[ \t]*$2" $ETHERS_FILE > /tmp/.webif/file-ethers-new - mv /tmp/.webif/file-ethers-new /tmp/.webif/file-ethers - ;; - esac - ETHERS_FILE=/tmp/.webif/file-ethers -} - -empty "$FORM_add_host" || { - # add a host to /etc/hosts - validate <>|required|$FORM_host_ip -hostname|FORM_host_name|@TR<>|required|$FORM_host_name -EOF - equal "$?" 0 && update_hosts add "$FORM_host_ip" "$FORM_host_name" -} -empty "$FORM_add_dhcp" || { - # add a host to /etc/ethers - validate <>|required|$FORM_dhcp_mac -ip|FORM_dhcp_ip|@TR<>|required|$FORM_dhcp_ip -EOF - equal "$?" 0 && update_ethers add "$FORM_dhcp_mac" "$FORM_dhcp_ip" -} - -empty "$FORM_remove_host" || update_hosts del "$FORM_remove_ip" "$FORM_remove_name" -empty "$FORM_remove_dhcp" || update_ethers del "$FORM_remove_mac" - -header "Network" "Hosts" "@TR<>" '' - -# Hosts in /etc/hosts -awk -v "url=$SCRIPT_NAME" \ - -v "ip=$FORM_host_ip" \ - -v "name=$FORM_host_name" \ - -f /usr/lib/webif/common.awk \ - -f - $HOSTS_FILE <>") - print "" - print "" - print "" -} - -# only for valid IPv4 addresses -(\$1 ~ /^[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*$/) { - gsub(/#.*$/, ""); - output = "" - names_found = 0 - n = split(\$0, names, "[ \\t]") - first = 1 - for (i = 2; i <= n; i++) { - if (names[i] != "") { - if (first != 1) output = output "" - output = output "" - first = 0 - names_found++ - } - } - if (names_found > 0) { - print "" output - print "" - } -} - -END { - print "" - print "" - print "" - print "
@TR<>@TR<>

" names[i] "@TR<>
" \$1 "

" textinput("host_ip", ip) "" textinput("host_name", name) "" button("add_host", "Add") "
" - end_form() -} -EOF - -# Static DHCP mappings (/etc/ethers) -awk -v "url=$SCRIPT_NAME" \ - -v "mac=$FORM_dhcp_mac" \ - -v "ip=$FORM_dhcp_ip" -f /usr/lib/webif/common.awk -f - $ETHERS_FILE <" - start_form("@TR<>") - print "" - print "" -} - -# only for valid MAC addresses -(\$1 ~ /^[0-9A-Fa-f][0-9A-Fa-f]:[0-9A-Fa-f][0-9A-Fa-f]:[0-9A-Fa-f][0-9A-Fa-f]:[0-9A-Fa-f][0-9A-Fa-f]:[0-9A-Fa-f][0-9A-Fa-f]:[0-9A-Fa-f][0-9A-Fa-f]$/) { - gsub(/#.*$/, ""); - print "" -} - -END { - print "" - print "
@TR<>@TR<>
" \$1 "" \$2 "@TR<>
" textinput("dhcp_mac", mac) "" textinput("dhcp_ip", ip) "" button("add_dhcp", "Add") "
" - print "" - end_form(); -} -EOF - -footer ?> - diff --git a/openwrt/package/webif/files/www/cgi-bin/webif/info.sh b/openwrt/package/webif/files/www/cgi-bin/webif/info.sh index 1eee7f6808..cc7639702c 100755 --- a/openwrt/package/webif/files/www/cgi-bin/webif/info.sh +++ b/openwrt/package/webif/files/www/cgi-bin/webif/info.sh @@ -40,5 +40,5 @@ EOF footer ?> diff --git a/openwrt/package/webif/files/www/cgi-bin/webif/ipkg.sh b/openwrt/package/webif/files/www/cgi-bin/webif/ipkg.sh deleted file mode 100755 index 4c68297246..0000000000 --- a/openwrt/package/webif/files/www/cgi-bin/webif/ipkg.sh +++ /dev/null @@ -1,55 +0,0 @@ -#!/usr/bin/webif-page ->" -?> -

@TR<>

-
-
-

@TR<>

- -" -} -' -?> -
" $1 "@TR<>
-
-
-

@TR<>

- -&- | sed -e 's, ,,' -e 's,/usr/lib/ipkg/lists/,,' | awk -F: ' -$1 ~ /status/ { - installed[$3]++; -} -($1 !~ /terminated/) && ($1 !~ /\/status/) && (!installed[$3]) { - if (current != $1) print "" - link=$3 - gsub(/\+/,"%2B",link) - print "" - current=$1 -} -' -?> -
" $1 "
" $3 "@TR<>
-
- -
- - - diff --git a/openwrt/package/webif/files/www/cgi-bin/webif/lan.sh b/openwrt/package/webif/files/www/cgi-bin/webif/lan.sh deleted file mode 100755 index 3ed6a52b11..0000000000 --- a/openwrt/package/webif/files/www/cgi-bin/webif/lan.sh +++ /dev/null @@ -1,53 +0,0 @@ -#!/usr/bin/webif-page ->|required' && { - FORM_dns="$LISTVAL" - save_setting network lan_dns "$FORM_dns" -} -FORM_dnsadd=${FORM_dnsadd:-192.168.1.1} - -if empty "$FORM_submit"; then - FORM_lan_ipaddr=${lan_ipaddr:-$(nvram get lan_ipaddr)} - FORM_lan_netmask=${lan_netmask:-$(nvram get lan_netmask)} - FORM_lan_gateway=${lan_gateway:-$(nvram get lan_gateway)} -else - SAVED=1 - validate <>|required|$FORM_lan_ipaddr -netmask|FORM_lan_netmask|@TR<>|required|$FORM_lan_netmask -ip|FORM_lan_gateway|@TR<>||$FORM_lan_gateway -EOF - equal "$?" 0 && { - save_setting network lan_ipaddr $FORM_lan_ipaddr - save_setting network lan_netmask $FORM_lan_netmask - save_setting network lan_gateway $FORM_lan_gateway - } -fi - -header "Network" "LAN" "@TR<>" '' "$SCRIPT_NAME" - -display_form <> -field|@TR<> -text|lan_ipaddr|$FORM_lan_ipaddr -field|@TR<> -text|lan_netmask|$FORM_lan_netmask -field|@TR<> -text|lan_gateway|$FORM_lan_gateway -end_form -start_form|@TR<> -listedit|dns|$SCRIPT_NAME?|$FORM_dns|$FORM_dnsadd -helpitem|Note -helptext|Helptext DNS save#You need save your settings on this page before adding/removing DNS servers -end_form -EOF - -footer ?> - diff --git a/openwrt/package/webif/files/www/cgi-bin/webif/leases.sh b/openwrt/package/webif/files/www/cgi-bin/webif/leases.sh deleted file mode 100755 index 48364f300d..0000000000 --- a/openwrt/package/webif/files/www/cgi-bin/webif/leases.sh +++ /dev/null @@ -1,38 +0,0 @@ -#!/usr/bin/webif-page ->" -?> - - - - - - - - - 0 { - print "" - print "" - print "" - print "" - print "" - print "" -} -' /tmp/dhcp.leases ?> - -
@TR<>@TR<>@TR<>@TR<>
" $2 "" $3 "" $4 "" - t = $1 - date - h = int(t / 60 / 60) - if (h > 0) printf h "h " - m = int(t / 60 % 60) - if (m > 0) printf m "min " - s = int(t % 60) - printf s "sec " - printf "
- - - diff --git a/openwrt/package/webif/files/www/cgi-bin/webif/network-hosts.sh b/openwrt/package/webif/files/www/cgi-bin/webif/network-hosts.sh new file mode 100755 index 0000000000..aeb58e1597 --- /dev/null +++ b/openwrt/package/webif/files/www/cgi-bin/webif/network-hosts.sh @@ -0,0 +1,158 @@ +#!/usr/bin/webif-page +&- 2>&- +exists $ETHERS_FILE || touch $ETHERS_FILE >&- 2>&- + +update_hosts() { + exists /tmp/.webif/* || mkdir -p /tmp/.webif + awk -v "mode=$1" -v "ip=$2" -v "name=$3" ' +BEGIN { + FS="[ \t]" + host_added = 0 +} +{ processed = 0 } +(mode == "del") && (ip == $1) { + names_found = 0 + n = split($0, names, "[ \t]") + output = $1 " " + for (i = 2; i <= n; i++) { + if ((names[i] != "") && (names[i] != name)) { + output = output names[i] " " + names_found++ + } + } + if (names_found > 0) print output + processed = 1 +} +(mode == "add") && (ip == $1) { + print $0 " " name + host_added = 1 + processed = 1 +} +processed == 0 { + print $0 +} +END { + if ((mode == "add") && (host_added == 0)) print ip " " name +}' "$HOSTS_FILE" > /tmp/.webif/file-hosts-new + mv "/tmp/.webif/file-hosts-new" "/tmp/.webif/file-hosts" + HOSTS_FILE=/tmp/.webif/file-hosts +} + +update_ethers() { + exists /tmp/.webif/* || mkdir -p /tmp/.webif + case "$1" in + add) + grep -E -v "^[ \t]*$2" $ETHERS_FILE > /tmp/.webif/file-ethers-new + echo "$2 $3" >> /tmp/.webif/file-ethers-new + mv /tmp/.webif/file-ethers-new /tmp/.webif/file-ethers + ;; + del) + grep -E -v "^[ \t]*$2" $ETHERS_FILE > /tmp/.webif/file-ethers-new + mv /tmp/.webif/file-ethers-new /tmp/.webif/file-ethers + ;; + esac + ETHERS_FILE=/tmp/.webif/file-ethers +} + +empty "$FORM_add_host" || { + # add a host to /etc/hosts + validate <>|required|$FORM_host_ip +hostname|FORM_host_name|@TR<>|required|$FORM_host_name +EOF + equal "$?" 0 && update_hosts add "$FORM_host_ip" "$FORM_host_name" +} +empty "$FORM_add_dhcp" || { + # add a host to /etc/ethers + validate <>|required|$FORM_dhcp_mac +ip|FORM_dhcp_ip|@TR<>|required|$FORM_dhcp_ip +EOF + equal "$?" 0 && update_ethers add "$FORM_dhcp_mac" "$FORM_dhcp_ip" +} + +empty "$FORM_remove_host" || update_hosts del "$FORM_remove_ip" "$FORM_remove_name" +empty "$FORM_remove_dhcp" || update_ethers del "$FORM_remove_mac" + +header "Network" "Hosts" "@TR<>" '' + +# Hosts in /etc/hosts +awk -v "url=$SCRIPT_NAME" \ + -v "ip=$FORM_host_ip" \ + -v "name=$FORM_host_name" \ + -f /usr/lib/webif/common.awk \ + -f - $HOSTS_FILE <>") + print "" + print "" + print "" +} + +# only for valid IPv4 addresses +(\$1 ~ /^[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*$/) { + gsub(/#.*$/, ""); + output = "" + names_found = 0 + n = split(\$0, names, "[ \\t]") + first = 1 + for (i = 2; i <= n; i++) { + if (names[i] != "") { + if (first != 1) output = output "" + output = output "" + first = 0 + names_found++ + } + } + if (names_found > 0) { + print "" output + print "" + } +} + +END { + print "" + print "" + print "" + print "
@TR<>@TR<>

" names[i] "@TR<>
" \$1 "

" textinput("host_ip", ip) "" textinput("host_name", name) "" button("add_host", "Add") "
" + end_form() +} +EOF + +# Static DHCP mappings (/etc/ethers) +awk -v "url=$SCRIPT_NAME" \ + -v "mac=$FORM_dhcp_mac" \ + -v "ip=$FORM_dhcp_ip" -f /usr/lib/webif/common.awk -f - $ETHERS_FILE <" + start_form("@TR<>") + print "" + print "" +} + +# only for valid MAC addresses +(\$1 ~ /^[0-9A-Fa-f][0-9A-Fa-f]:[0-9A-Fa-f][0-9A-Fa-f]:[0-9A-Fa-f][0-9A-Fa-f]:[0-9A-Fa-f][0-9A-Fa-f]:[0-9A-Fa-f][0-9A-Fa-f]:[0-9A-Fa-f][0-9A-Fa-f]$/) { + gsub(/#.*$/, ""); + print "" +} + +END { + print "" + print "
@TR<>@TR<>
" \$1 "" \$2 "@TR<>
" textinput("dhcp_mac", mac) "" textinput("dhcp_ip", ip) "" button("add_dhcp", "Add") "
" + print "" + end_form(); +} +EOF + +footer ?> + diff --git a/openwrt/package/webif/files/www/cgi-bin/webif/network-lan.sh b/openwrt/package/webif/files/www/cgi-bin/webif/network-lan.sh new file mode 100755 index 0000000000..84137b6fc6 --- /dev/null +++ b/openwrt/package/webif/files/www/cgi-bin/webif/network-lan.sh @@ -0,0 +1,53 @@ +#!/usr/bin/webif-page +>|required' && { + FORM_dns="$LISTVAL" + save_setting network lan_dns "$FORM_dns" +} +FORM_dnsadd=${FORM_dnsadd:-192.168.1.1} + +if empty "$FORM_submit"; then + FORM_lan_ipaddr=${lan_ipaddr:-$(nvram get lan_ipaddr)} + FORM_lan_netmask=${lan_netmask:-$(nvram get lan_netmask)} + FORM_lan_gateway=${lan_gateway:-$(nvram get lan_gateway)} +else + SAVED=1 + validate <>|required|$FORM_lan_ipaddr +netmask|FORM_lan_netmask|@TR<>|required|$FORM_lan_netmask +ip|FORM_lan_gateway|@TR<>||$FORM_lan_gateway +EOF + equal "$?" 0 && { + save_setting network lan_ipaddr $FORM_lan_ipaddr + save_setting network lan_netmask $FORM_lan_netmask + save_setting network lan_gateway $FORM_lan_gateway + } +fi + +header "Network" "LAN" "@TR<>" '' "$SCRIPT_NAME" + +display_form <> +field|@TR<> +text|lan_ipaddr|$FORM_lan_ipaddr +field|@TR<> +text|lan_netmask|$FORM_lan_netmask +field|@TR<> +text|lan_gateway|$FORM_lan_gateway +end_form +start_form|@TR<> +listedit|dns|$SCRIPT_NAME?|$FORM_dns|$FORM_dnsadd +helpitem|Note +helptext|Helptext DNS save#You need save your settings on this page before adding/removing DNS servers +end_form +EOF + +footer ?> + diff --git a/openwrt/package/webif/files/www/cgi-bin/webif/network-wan.sh b/openwrt/package/webif/files/www/cgi-bin/webif/network-wan.sh new file mode 100755 index 0000000000..315626583f --- /dev/null +++ b/openwrt/package/webif/files/www/cgi-bin/webif/network-wan.sh @@ -0,0 +1,220 @@ +#!/usr/bin/webif-page +>|required' && { + FORM_dns="$LISTVAL" + save_setting network wan_dns "$FORM_dns" +} +FORM_dnsadd=${FORM_dnsadd:-192.168.1.1} + +if empty "$FORM_submit"; then + FORM_wan_proto=${wan_proto:-$(nvram get wan_proto)} + case "$FORM_wan_proto" in + # supported types + static|dhcp|pptp|pppoe) ;; + # otherwise select "none" + *) FORM_wan_proto="none";; + esac + + # pptp, dhcp and static common + FORM_wan_ipaddr=${wan_ipaddr:-$(nvram get wan_ipaddr)} + FORM_wan_netmask=${wan_netmask:-$(nvram get wan_netmask)} + FORM_wan_gateway=${wan_gateway:-$(nvram get wan_gateway)} + + # ppp common + FORM_ppp_username=${ppp_username:-$(nvram get ppp_username)} + FORM_ppp_passwd=${ppp_passwd:-$(nvram get ppp_passwd)} + FORM_ppp_idletime=${ppp_idletime:-$(nvram get ppp_idletime)} + FORM_ppp_redialperiod=${ppp_redialperiod:-$(nvram get ppp_redialperiod)} + FORM_ppp_mtu=${ppp_mtu:-$(nvram get ppp_mtu)} + + redial=${ppp_demand:-$(nvram get ppp_demand)} + case "$redial" in + 1|enabled|on) FORM_ppp_redial="demand";; + *) FORM_ppp_redial="persist";; + esac + + FORM_pptp_server_ip=${pptp_server_ip:-$(nvram get pptp_server_ip)} +else + SAVED=1 + + empty "$FORM_wan_proto" && { + ERROR="@TR<>" + return 255 + } + + case "$FORM_wan_proto" in + static) + V_IP="required" + V_NM="required" + ;; + pptp) + V_PPTP="required" + ;; + esac + +validate <>|$V_IP|$FORM_wan_ipaddr +netmask|FORM_wan_netmask|@TR<>|$V_NM|$FORM_wan_netmask +ip|FORM_wan_gateway|@TR<>||$FORM_wan_gateway +ip|FORM_pptp_server_ip|@TR<>|$V_PPTP|$FORM_pptp_server_ip +EOF + equal "$?" 0 && { + save_setting network wan_proto $FORM_wan_proto + + # Settings specific to one protocol type + case "$FORM_wan_proto" in + static) save_setting network wan_gateway $FORM_wan_gateway ;; + pptp) save_setting network pptp_server_ip "$FORM_pptp_server_ip" ;; + esac + + # Common settings for PPTP, Static and DHCP + case "$FORM_wan_proto" in + pptp|static|dhcp) + save_setting network wan_ipaddr $FORM_wan_ipaddr + save_setting network wan_netmask $FORM_wan_netmask + ;; + esac + + # Common PPP settings + case "$FORM_wan_proto" in + pppoe|pptp) + empty "$FORM_ppp_username" || save_setting network ppp_username $FORM_ppp_username + empty "$FORM_ppp_passwd" || save_setting network ppp_passwd $FORM_ppp_passwd + + # These can be blank + save_setting network ppp_idletime "$FORM_ppp_idletime" + save_setting network ppp_redialperiod "$FORM_ppp_redialperiod" + save_setting network ppp_mtu "$FORM_ppp_mtu" + + save_setting network wan_ifname "ppp0" + + case "$FORM_ppp_redial" in + demand) + save_setting network ppp_demand 1 + ;; + persist) + save_setting network ppp_demand "" + ;; + esac + ;; + *) + wan_ifname=${wan_ifname:-$(nvram get wan_ifname)} + [ -z "$wan_ifname" -o "${wan_ifname%%[0-9]*}" = "ppp" ] && { + wan_device=${wan_device:-$(nvram get wan_device)} + wan_device=${wan_device:-vlan1} + save_setting network wan_ifname "$wan_device" + } + ;; + esac + } +fi + +# detect pptp package and compile option +[ -x /sbin/ifup.pptp ] && { + PPTP_OPTION="option|pptp|PPTP" + PPTP_SERVER_OPTION="field|PPTP Server IP|pptp_server|hidden +text|pptp_server_ip|$FORM_pptp_server_ip" +} +[ -x /sbin/ifup.pppoe ] && { + PPPOE_OPTION="option|pppoe|PPPoE" +} + + +header "Network" "WAN" "@TR<>" ' onLoad="modechange()" ' "$SCRIPT_NAME" + +cat < + +EOF + +display_form <> +field|@TR<> +select|wan_proto|$FORM_wan_proto +option|none|@TR<> +option|dhcp|@TR<> +option|static|@TR<> +$PPPOE_OPTION +$PPTP_OPTION +helplink|http://wiki.openwrt.org/OpenWrtDocs/Configuration#head-b62c144b9886b221e0c4b870edb0dd23a7b6acab +end_form +start_form|@TR<>|ip_settings|hidden +field|@TR<>|ipaddr|hidden +text|wan_ipaddr|$FORM_wan_ipaddr +field|@TR<>|netmask|hidden +text|wan_netmask|$FORM_wan_netmask +field|@TR<>|gateway|hidden +text|wan_gateway|$FORM_wan_gateway +$PPTP_SERVER_OPTION +helpitem|IP Settings +helptext|Helptext IP Settings#IP Settings are optional for DHCP and PPTP. If you set them, they are used as defaults in case the DHCP server is unavailable. +end_form +start_form|@TR<>|dns|hidden +listedit|dns|$SCRIPT_NAME?wan_proto=static&|$FORM_dns|$FORM_dnsadd +helpitem|Note +helptext|Helptext DNS save#You should save your settings on this page before adding/removing DNS servers +end_form + +start_form|@TR<>|ppp_settings|hidden +field|@TR<>|redial|hidden +select|ppp_redial|$FORM_ppp_redial +option|demand|@TR<> +option|persist|@TR<> +field|@TR<>|demand_idletime|hidden +text|ppp_idletime|$FORM_ppp_idletime +helpitem|Maximum Idle Time +helptext|Helptext Idle Time#The number of seconds without internet traffic that the router should wait before disconnecting from the Internet (Connect on Demand only) +field|@TR<>|persist_redialperiod|hidden +text|ppp_redialperiod|$FORM_ppp_redialperiod +helpitem|Redial Timeout +helptext|Helptext Redial Timeout#The number of seconds to wait after receiving no response from the provider before trying to reconnect +field|@TR<>|username|hidden +text|ppp_username|$FORM_ppp_username +field|@TR<>|passwd|hidden +password|ppp_passwd|$FORM_ppp_passwd +field|@TR<>|mtu|hidden +text|ppp_mtu|$FORM_ppp_mtu +end_form +EOF + +footer ?> + diff --git a/openwrt/package/webif/files/www/cgi-bin/webif/network-wlan-advanced.sh b/openwrt/package/webif/files/www/cgi-bin/webif/network-wlan-advanced.sh new file mode 100755 index 0000000000..2d8caf49b3 --- /dev/null +++ b/openwrt/package/webif/files/www/cgi-bin/webif/network-wlan-advanced.sh @@ -0,0 +1,104 @@ +#!/usr/bin/webif-page +>" ' onLoad="modechange()"' "$SCRIPT_NAME" + +cat < + +EOF + +display_form <> +listedit|wds|$SCRIPT_NAME?|$FORM_wds|$FORM_wdsadd +end_form +start_form|@TR<> +listedit|maclist|$SCRIPT_NAME?|$FORM_maclist|$FORM_maclistadd +end_form +start_form|@TR<> +field|@TR<> +select|lazywds|$FORM_lazywds +option|1|@TR<> +option|0|@TR<> +field|@TR<> +text|wdstimeout|$FORM_wdstimeout +field|@TR<>: +select|macmode|$FORM_macmode +option|disabled|@TR<> +option|allow|@TR<> +option|deny|@TR<> +field|@TR<>: +select|antdiv|$FORM_antdiv +option|-1|@TR<> +option|0|@TR<> +option|1|@TR<> +option|3|@TR<> +field|@TR<> +text|distance|$FORM_distance +end_form +EOF + +footer ?> + diff --git a/openwrt/package/webif/files/www/cgi-bin/webif/network-wlan.sh b/openwrt/package/webif/files/www/cgi-bin/webif/network-wlan.sh new file mode 100755 index 0000000000..fee14b9594 --- /dev/null +++ b/openwrt/package/webif/files/www/cgi-bin/webif/network-wlan.sh @@ -0,0 +1,290 @@ +#!/usr/bin/webif-page +>" +for ch in $CHANNELS; do + F_CHANNELS="${F_CHANNELS} +option|$ch" +done + +if empty "$FORM_submit"; then + FORM_mode=${wl0_mode:-$(nvram get wl0_mode)} + infra=${wl0_infra:-$(nvram get wl0_infra)} + case "$infra" in + 0|off|disabled) FORM_mode=adhoc;; + esac + FORM_radio=${wl0_radio:-$(nvram get wl0_radio)} + case "$FORM_radio" in + 0|off|diabled) FORM_radio=0;; + *) FORM_radio=1;; + esac + + FORM_ssid=${wl0_ssid:-$(nvram get wl0_ssid)} + FORM_broadcast=${wl0_closed:-$(nvram get wl0_closed)} + case "$FORM_broadcast" in + 1|off|disabled) FORM_broadcast=1;; + *) FORM_broadcast=0;; + esac + FORM_channel=${wl0_channel:-$(nvram get wl0_channel)} + FORM_encryption=off + akm=${wl0_akm:-$(nvram get wl0_akm)} + case "$akm" in + psk) + FORM_encryption=psk + FORM_wpa1=wpa1 + ;; + psk2) + FORM_encryption=psk + FORM_wpa2=wpa2 + ;; + 'psk psk2') + FORM_encryption=psk + FORM_wpa1=wpa1 + FORM_wpa2=wpa2 + ;; + wpa) + FORM_encryption=wpa + FORM_wpa1=wpa1 + ;; + wpa2) + FORM_encryption=wpa + FORM_wpa2=wpa2 + ;; + 'wpa wpa2') + FORM_encryption=wpa + FORM_wpa1=wpa1 + FORM_wpa2=wpa2 + ;; + *) + FORM_wpa1=wpa1 + ;; + esac + FORM_wpa_psk=${wl0_wpa_psk:-$(nvram get wl0_wpa_psk)} + FORM_radius_key=${wl0_radius_key:-$(nvram get wl0_radius_key)} + FORM_radius_ipaddr=${wl0_radius_ipaddr:-$(nvram get wl0_radius_ipaddr)} + crypto=${wl0_crypto:-$(nvram get wl0_crypto)} + case "$crypto" in + tkip) + FORM_tkip=tkip + ;; + aes) + FORM_aes=aes + ;; + 'tkip+aes'|'aes+tkip') + FORM_aes=aes + FORM_tkip=tkip + ;; + *) + FORM_tkip=tkip + ;; + esac + equal "$FORM_encryption" "off" && { + wep=${wl0_wep:-$(nvram get wl0_wep)} + case "$wep" in + 1|enabled|on) FORM_encryption=wep;; + *) FORM_encryption=off;; + esac + } + FORM_key1=${wl0_key1:-$(nvram get wl0_key1)} + FORM_key2=${wl0_key2:-$(nvram get wl0_key2)} + FORM_key3=${wl0_key3:-$(nvram get wl0_key3)} + FORM_key4=${wl0_key4:-$(nvram get wl0_key4)} + key=${wl0_key:-$(nvram get wl0_key)} + FORM_key=${key:-1} +else + SAVED=1 + case "$FORM_encryption" in + wpa) V_RADIUS=" +string|FORM_radius_key|@TR<>|min=4 max=63 required|$FORM_radius_key +ip|FORM_radius_ipaddr|@TR<>|required|$FORM_radius_ipaddr";; + psk) V_PSK="wpapsk|FORM_wpa_psk|@TR<>|required|$FORM_wpa_psk";; + wep) V_WEP=" +int|FORM_key|@TR<>|min=1 max=4|$FORM_key +wep|FORM_key1|@TR<> 1||$FORM_key1 +wep|FORM_key2|@TR<> 2||$FORM_key2 +wep|FORM_key3|@TR<> 3||$FORM_key3 +wep|FORM_key4|@TR<> 4||$FORM_key4";; + esac + + validate <>|required|$FORM_ssid +int|FORM_channel|@TR<>|required min=0 max=$CHANNEL_MAX|$FORM_channel +$V_WEP +$V_RADIUS +$V_PSK +EOF + equal "$?" 0 && { + save_setting wireless wl0_radio "$FORM_radio" + + if equal "$FORM_mode" adhoc; then + FORM_mode=sta + infra="0" + fi + save_setting wireless wl0_mode "$FORM_mode" + save_setting wireless wl0_infra ${infra:-1} + + save_setting wireless wl0_ssid "$FORM_ssid" + save_setting wireless wl0_closed "$FORM_broadcast" + save_setting wireless wl0_channel "$FORM_channel" + + crypto="" + equal "$FORM_aes" aes && crypto="aes" + equal "$FORM_tkip" tkip && crypto="tkip${crypto:++$crypto}" + save_setting wireless wl0_crypto "$crypto" + + case "$FORM_encryption" in + psk) + case "${FORM_wpa1}${FORM_wpa2}" in + wpa1) save_setting wireless wl0_akm "psk";; + wpa2) save_setting wireless wl0_akm "psk2";; + wpa1wpa2) save_setting wireless wl0_akm "psk psk2";; + esac + save_setting wireless wl0_wpa_psk "$FORM_wpa_psk" + save_setting wireless wl0_wep "disabled" + ;; + wpa) + case "${FORM_wpa1}${FORM_wpa2}" in + wpa1) save_setting wireless wl0_akm "wpa";; + wpa2) save_setting wireless wl0_akm "wpa2";; + wpa1wpa2) save_setting wireless wl0_akm "wpa wpa2";; + esac + save_setting wireless wl0_radius_ipaddr "$FORM_radius_ipaddr" + save_setting wireless wl0_radius_key "$FORM_radius_key" + save_setting wireless wl0_wep "disabled" + ;; + wep) + save_setting wireless wl0_wep enabled + save_setting wireless wl0_akm "none" + save_setting wireless wl0_key1 "$FORM_key1" + save_setting wireless wl0_key2 "$FORM_key2" + save_setting wireless wl0_key3 "$FORM_key3" + save_setting wireless wl0_key4 "$FORM_key4" + save_setting wireless wl0_key "$FORM_key" + ;; + off) + save_setting wireless wl0_akm "none" + save_setting wireless wl0_wep disabled + ;; + esac + } +fi + +header "Network" "Wireless" "@TR<>" ' onLoad="modechange()" ' "$SCRIPT_NAME" + +cat < + + +EOF + +display_form <> +field|@TR<> +select|radio|$FORM_radio +option|1|@TR<> +option|0|@TR<> +field|@TR<> +select|broadcast|$FORM_broadcast +option|0|@TR<> +option|1|@TR<> +field|@TR<> +text|ssid|$FORM_ssid +helpitem|ESSID +helptext|Helptext ESSID#Name of your Wireless Network +field|@TR<> +select|channel|$FORM_channel +$F_CHANNELS +field|@TR<> +select|mode|$FORM_mode +option|ap|@TR<> +option|sta|@TR<> +option|wet|@TR<> (@TR<>) +option|adhoc|@TR<> +helpitem|WLAN Mode#Mode +helptext|Helptext Operation mode#This sets the operation mode of your wireless network. Selecting 'Client (Bridge)' will not change your network interface settings. It will only set some parameters in the wireless driver that allow for limited bridging of the interface. +helplink|http://wiki.openwrt.org/OpenWrtDocs/Configuration#head-7126c5958e237d603674b3a9739c9d23bdfdb293 +end_form +start_form|@TR<> +field|@TR<> +select|encryption|$FORM_encryption +option|off|@TR<> +option|wep|WEP +option|psk|WPA (@TR<>) +option|wpa|WPA (RADIUS) +helpitem|Encryption Type +helptext|Helptext Encryption Type#'WPA (RADIUS)' is only supported in Access Point mode.
'WPA (PSK)' doesn't work in Ad-Hoc mode. +field|@TR<>|wpa_support|hidden +checkbox|wpa1|$FORM_wpa1|wpa1|WPA1 +checkbox|wpa2|$FORM_wpa2|wpa2|WPA2 +field|@TR<>|wpa_crypto|hidden +checkbox|tkip|$FORM_tkip|tkip|RC4 (TKIP) +checkbox|aes|$FORM_aes|aes|AES +field|WPA @TR<>|wpapsk|hidden +text|wpa_psk|$FORM_wpa_psk +field|@TR<>|radius_ip|hidden +text|radius_ipaddr|$FORM_radius_ipaddr +field|@TR<>|radiuskey|hidden +text|radius_key|$FORM_radius_key +field|@TR<>|wep_keys|hidden +radio|key|$FORM_key|1 +text|key1|$FORM_key1|
+radio|key|$FORM_key|2 +text|key2|$FORM_key2|
+radio|key|$FORM_key|3 +text|key3|$FORM_key3|
+radio|key|$FORM_key|4 +text|key4|$FORM_key4|
+end_form +EOF + +footer ?> + diff --git a/openwrt/package/webif/files/www/cgi-bin/webif/password.sh b/openwrt/package/webif/files/www/cgi-bin/webif/password.sh deleted file mode 100755 index f8618d8ab8..0000000000 --- a/openwrt/package/webif/files/www/cgi-bin/webif/password.sh +++ /dev/null @@ -1,40 +0,0 @@ -#!/usr/bin/webif-page -" - } - empty "$ERROR" && { - RES=$( - ( - echo "$FORM_pw1" - sleep 1 - echo "$FORM_pw2" - ) | passwd root 2>&1 - ) - equal "$?" 0 || ERROR="
$RES
" - } -} - -header "System" "Password Change" "@TR<>" '' "$SCRIPT_NAME" - -display_form <> -field|@TR<>: -password|pw1 -field|@TR<>: -password|pw2 -end_form -EOF - -footer ?> - - diff --git a/openwrt/package/webif/files/www/cgi-bin/webif/status-connection.sh b/openwrt/package/webif/files/www/cgi-bin/webif/status-connection.sh new file mode 100755 index 0000000000..fbf329b1b3 --- /dev/null +++ b/openwrt/package/webif/files/www/cgi-bin/webif/status-connection.sh @@ -0,0 +1,29 @@ +#!/usr/bin/webif-page +>" +?> + + + + + + + + + + + + + + + + + + +
@TR<>


@TR<>
&- | awk '$0 ~ /^Active UNIX/ {ignore = 1}; ignore != 1 { print $0 }' ?>
+ + + diff --git a/openwrt/package/webif/files/www/cgi-bin/webif/status-dhcp.sh b/openwrt/package/webif/files/www/cgi-bin/webif/status-dhcp.sh new file mode 100755 index 0000000000..5517b781f4 --- /dev/null +++ b/openwrt/package/webif/files/www/cgi-bin/webif/status-dhcp.sh @@ -0,0 +1,38 @@ +#!/usr/bin/webif-page +>" +?> + + + + + + + + + 0 { + print "" + print "" + print "" + print "" + print "" + print "" +} +' /tmp/dhcp.leases ?> + +
@TR<>@TR<>@TR<>@TR<>
" $2 "" $3 "" $4 "" + t = $1 - date + h = int(t / 60 / 60) + if (h > 0) printf h "h " + m = int(t / 60 % 60) + if (m > 0) printf m "min " + s = int(t % 60) + printf s "sec " + printf "
+ + + diff --git a/openwrt/package/webif/files/www/cgi-bin/webif/status-wireless.sh b/openwrt/package/webif/files/www/cgi-bin/webif/status-wireless.sh new file mode 100755 index 0000000000..c7ad0a3068 --- /dev/null +++ b/openwrt/package/webif/files/www/cgi-bin/webif/status-wireless.sh @@ -0,0 +1,12 @@ +#!/usr/bin/webif-page +>" +?> + +
&1 | grep -v 'no wireless' | grep '\w' ?>
+ + + diff --git a/openwrt/package/webif/files/www/cgi-bin/webif/system-ipkg.sh b/openwrt/package/webif/files/www/cgi-bin/webif/system-ipkg.sh new file mode 100755 index 0000000000..b21918d989 --- /dev/null +++ b/openwrt/package/webif/files/www/cgi-bin/webif/system-ipkg.sh @@ -0,0 +1,55 @@ +#!/usr/bin/webif-page +>" +?> +

@TR<>

+
+
+

@TR<>

+ +" +} +' +?> +
" $1 "@TR<>
+
+
+

@TR<>

+ +&- | sed -e 's, ,,' -e 's,/usr/lib/ipkg/lists/,,' | awk -F: ' +$1 ~ /status/ { + installed[$3]++; +} +($1 !~ /terminated/) && ($1 !~ /\/status/) && (!installed[$3]) { + if (current != $1) print "" + link=$3 + gsub(/\+/,"%2B",link) + print "" + current=$1 +} +' +?> +
" $1 "
" $3 "@TR<>
+
+ +
+ + + diff --git a/openwrt/package/webif/files/www/cgi-bin/webif/system-password.sh b/openwrt/package/webif/files/www/cgi-bin/webif/system-password.sh new file mode 100755 index 0000000000..87a768aaac --- /dev/null +++ b/openwrt/package/webif/files/www/cgi-bin/webif/system-password.sh @@ -0,0 +1,40 @@ +#!/usr/bin/webif-page +" + } + empty "$ERROR" && { + RES=$( + ( + echo "$FORM_pw1" + sleep 1 + echo "$FORM_pw2" + ) | passwd root 2>&1 + ) + equal "$?" 0 || ERROR="
$RES
" + } +} + +header "System" "Password Change" "@TR<>" '' "$SCRIPT_NAME" + +display_form <> +field|@TR<>: +password|pw1 +field|@TR<>: +password|pw2 +end_form +EOF + +footer ?> + + diff --git a/openwrt/package/webif/files/www/cgi-bin/webif/system-settings.sh b/openwrt/package/webif/files/www/cgi-bin/webif/system-settings.sh new file mode 100755 index 0000000000..cbb7f5ab94 --- /dev/null +++ b/openwrt/package/webif/files/www/cgi-bin/webif/system-settings.sh @@ -0,0 +1,57 @@ +#!/usr/bin/webif-page +' /usr/lib/webif/lang/*/*.txt 2>/dev/null | awk -f /usr/lib/webif/languages.awk)" + +header "System" "Settings" "@TR<>" '' "$SCRIPT_NAME" + +is_bcm947xx && bootwait_form="field|boot_wait +select|boot_wait|$FORM_boot_wait +option|on|@TR<> +option|off|@TR<>" + +display_form <> +field|@TR<> +text|hostname|$FORM_hostname +$bootwait_form +field|@TR<> +select|language|$FORM_language +$LANGUAGES +end_form +EOF + +footer ?> + + diff --git a/openwrt/package/webif/files/www/cgi-bin/webif/system-upgrade.sh b/openwrt/package/webif/files/www/cgi-bin/webif/system-upgrade.sh new file mode 100755 index 0000000000..5bdd2f1941 --- /dev/null +++ b/openwrt/package/webif/files/www/cgi-bin/webif/system-upgrade.sh @@ -0,0 +1,113 @@ +#!/usr/bin/webif-page -p /bin/sh +. /usr/lib/webif/webif.sh + +do_upgrade() { + # free some memory :) + ps | grep -vE 'Command|init|\[[kbmj]|httpd|haserl|bin/sh|awk|kill|ps|webif' | awk '{ print $1 }' | xargs kill -KILL + MEMFREE="$(awk 'BEGIN{ mem = 0 } ($1 == "MemFree:") || ($1 == "Cached:") {mem += int($2)} END{print mem}' /proc/meminfo)" + empty "$ERASE_FS" || MTD_OPT="-e linux" + if [ $(($MEMFREE)) -ge 4096 ]; then + bstrip "$BOUNDARY" > /tmp/firmware.bin + mtd $MTD_OPT -q -r write /tmp/firmware.bin linux + else + # Not enough memory for storing the firmware on tmpfs + bstrip "$BOUNDARY" | mtd $MTD_OPT -q -q -r write - linux + fi + echo "@TR<>." +} + +read_var() { + NAME="" + while :; do + read LINE + LINE="${LINE%%[^0-9A-Za-z]}" + equal "$LINE" "$BOUNDARY" && read LINE + empty "$NAME$LINE" && exit + case "${LINE%%:*}" in + Content-Disposition) + NAME="${LINE##*; name=\"}" + NAME="${NAME%%\"*}" + ;; + esac + empty "$LINE" && return + done +} + + +NOINPUT=1 +header "System" "Firmware Upgrade" "@TR<>" + +equal "$REQUEST_METHOD" "GET" && { + cat < + +function statusupdate() { + document.getElementById("form_submit").style.display = "none"; + document.getElementById("status_text").style.display = "inline"; + + return true; +} +function printStatus() { + document.write(''); +} + +
+ + + + + + + + + + + + + + +
@TR<>: + @TR<> +
@TR<> + +
+ + + +
+
+EOF +} +equal "$REQUEST_METHOD" "POST" && { + equal "${CONTENT_TYPE%%;*}" "multipart/form-data" || ERR=1 + BOUNDARY="${CONTENT_TYPE##*boundary=}" + empty "$BOUNDARY" && ERR=1 + + empty "$ERR" || { + echo "Wrong data format" + footer + exit + } +cat < +
+EOF
+	while :; do
+		read_var
+		empty "$NAME" && exit
+		case "$NAME" in
+			erase_fs)
+				ERASE_FS=1
+				bstrip "$BOUNDARY" > /dev/null
+			;;
+			firmware) do_upgrade;;
+		esac
+	done
+cat <
+EOF
+}
+
+footer
+
+##WEBIF:name:System:400:Firmware Upgrade
diff --git a/openwrt/package/webif/files/www/cgi-bin/webif/system.sh b/openwrt/package/webif/files/www/cgi-bin/webif/system.sh
deleted file mode 100755
index e21f8d7ecc..0000000000
--- a/openwrt/package/webif/files/www/cgi-bin/webif/system.sh
+++ /dev/null
@@ -1,57 +0,0 @@
-#!/usr/bin/webif-page
-' /usr/lib/webif/lang/*/*.txt 2>/dev/null | awk -f /usr/lib/webif/languages.awk)"
-
-header "System" "Settings" "@TR<>" '' "$SCRIPT_NAME"
-
-is_bcm947xx && bootwait_form="field|boot_wait
-select|boot_wait|$FORM_boot_wait
-option|on|@TR<>
-option|off|@TR<>"
-
-display_form <>
-field|@TR<>
-text|hostname|$FORM_hostname
-$bootwait_form
-field|@TR<>
-select|language|$FORM_language
-$LANGUAGES
-end_form
-EOF
-
-footer ?>
-
-
diff --git a/openwrt/package/webif/files/www/cgi-bin/webif/upgrade.sh b/openwrt/package/webif/files/www/cgi-bin/webif/upgrade.sh
deleted file mode 100755
index c5750fad0b..0000000000
--- a/openwrt/package/webif/files/www/cgi-bin/webif/upgrade.sh
+++ /dev/null
@@ -1,113 +0,0 @@
-#!/usr/bin/webif-page -p /bin/sh
-. /usr/lib/webif/webif.sh
-
-do_upgrade() {
-	# free some memory :)
-	ps | grep -vE 'Command|init|\[[kbmj]|httpd|haserl|bin/sh|awk|kill|ps|webif' | awk '{ print $1 }' | xargs kill -KILL
-	MEMFREE="$(awk 'BEGIN{ mem = 0 } ($1 == "MemFree:") || ($1 == "Cached:") {mem += int($2)} END{print mem}' /proc/meminfo)"
-	empty "$ERASE_FS" || MTD_OPT="-e linux"
-	if [ $(($MEMFREE)) -ge 4096 ]; then
-		bstrip "$BOUNDARY" > /tmp/firmware.bin
-		mtd $MTD_OPT -q -r write /tmp/firmware.bin linux
-	else
-		# Not enough memory for storing the firmware on tmpfs
-		bstrip "$BOUNDARY" | mtd $MTD_OPT -q -q -r write - linux
-	fi
-	echo "@TR<>."
-}
-
-read_var() {
-	NAME=""
-	while :; do
-		read LINE
-		LINE="${LINE%%[^0-9A-Za-z]}"
-		equal "$LINE" "$BOUNDARY" && read LINE
-		empty "$NAME$LINE" && exit
-		case "${LINE%%:*}" in
-			Content-Disposition)
-				NAME="${LINE##*; name=\"}"
-				NAME="${NAME%%\"*}"
-			;;
-		esac
-		empty "$LINE" && return
-	done
-}
-
-
-NOINPUT=1
-header "System" "Firmware Upgrade" "@TR<>"
-
-equal "$REQUEST_METHOD" "GET" && {
-	cat <
-	
-function statusupdate() {
-	document.getElementById("form_submit").style.display = "none";
-	document.getElementById("status_text").style.display = "inline";
-
-	return true;
-}
-function printStatus() {
-	document.write('');
-}
-	
-	
- - - - - - - - - - - - - - -
@TR<>: - @TR<> -
@TR<> - -
- - - -
-
-EOF -} -equal "$REQUEST_METHOD" "POST" && { - equal "${CONTENT_TYPE%%;*}" "multipart/form-data" || ERR=1 - BOUNDARY="${CONTENT_TYPE##*boundary=}" - empty "$BOUNDARY" && ERR=1 - - empty "$ERR" || { - echo "Wrong data format" - footer - exit - } -cat < -
-EOF
-	while :; do
-		read_var
-		empty "$NAME" && exit
-		case "$NAME" in
-			erase_fs)
-				ERASE_FS=1
-				bstrip "$BOUNDARY" > /dev/null
-			;;
-			firmware) do_upgrade;;
-		esac
-	done
-cat <
-EOF
-}
-
-footer
-
-##WEBIF:name:System:4:Firmware Upgrade
diff --git a/openwrt/package/webif/files/www/cgi-bin/webif/wan.sh b/openwrt/package/webif/files/www/cgi-bin/webif/wan.sh
deleted file mode 100755
index e172c56eaa..0000000000
--- a/openwrt/package/webif/files/www/cgi-bin/webif/wan.sh
+++ /dev/null
@@ -1,220 +0,0 @@
-#!/usr/bin/webif-page
->|required' && {
-	FORM_dns="$LISTVAL"
-	save_setting network wan_dns "$FORM_dns"
-}
-FORM_dnsadd=${FORM_dnsadd:-192.168.1.1}
-
-if empty "$FORM_submit"; then
-	FORM_wan_proto=${wan_proto:-$(nvram get wan_proto)}
-	case "$FORM_wan_proto" in
-		# supported types
-		static|dhcp|pptp|pppoe) ;;
-		# otherwise select "none"
-		*) FORM_wan_proto="none";;
-	esac
-	
-	# pptp, dhcp and static common
-	FORM_wan_ipaddr=${wan_ipaddr:-$(nvram get wan_ipaddr)}
-	FORM_wan_netmask=${wan_netmask:-$(nvram get wan_netmask)}
-	FORM_wan_gateway=${wan_gateway:-$(nvram get wan_gateway)}
-	
-  	# ppp common
-	FORM_ppp_username=${ppp_username:-$(nvram get ppp_username)}
-	FORM_ppp_passwd=${ppp_passwd:-$(nvram get ppp_passwd)}
-	FORM_ppp_idletime=${ppp_idletime:-$(nvram get ppp_idletime)}
-	FORM_ppp_redialperiod=${ppp_redialperiod:-$(nvram get ppp_redialperiod)}
-	FORM_ppp_mtu=${ppp_mtu:-$(nvram get ppp_mtu)}
-
-	redial=${ppp_demand:-$(nvram get ppp_demand)}
-	case "$redial" in
-		1|enabled|on) FORM_ppp_redial="demand";;	
-		*) FORM_ppp_redial="persist";;	
-	esac
-	
-	FORM_pptp_server_ip=${pptp_server_ip:-$(nvram get pptp_server_ip)}
-else
-	SAVED=1
-
-	empty "$FORM_wan_proto" && {
-		ERROR="@TR<>" 
-		return 255
-	}
-
-	case "$FORM_wan_proto" in
-		static)
-			V_IP="required"
-			V_NM="required"
-			;;
-		pptp)
-			V_PPTP="required"
-			;;
-	esac
-
-validate <>|$V_IP|$FORM_wan_ipaddr
-netmask|FORM_wan_netmask|@TR<>|$V_NM|$FORM_wan_netmask
-ip|FORM_wan_gateway|@TR<>||$FORM_wan_gateway
-ip|FORM_pptp_server_ip|@TR<>|$V_PPTP|$FORM_pptp_server_ip
-EOF
-	equal "$?" 0 && {
-		save_setting network wan_proto $FORM_wan_proto
-		
-		# Settings specific to one protocol type
-		case "$FORM_wan_proto" in
-			static) save_setting network wan_gateway $FORM_wan_gateway ;;
-			pptp) save_setting network pptp_server_ip "$FORM_pptp_server_ip" ;;
-		esac
-		
-		# Common settings for PPTP, Static and DHCP 
-		case "$FORM_wan_proto" in
-			pptp|static|dhcp)
-				save_setting network wan_ipaddr $FORM_wan_ipaddr
-				save_setting network wan_netmask $FORM_wan_netmask 
-			;;
-		esac
-		
-		# Common PPP settings
-		case "$FORM_wan_proto" in
-			pppoe|pptp)
-				empty "$FORM_ppp_username" || save_setting network ppp_username $FORM_ppp_username
-				empty "$FORM_ppp_passwd" || save_setting network ppp_passwd $FORM_ppp_passwd
-		
-				# These can be blank
-				save_setting network ppp_idletime "$FORM_ppp_idletime"
-				save_setting network ppp_redialperiod "$FORM_ppp_redialperiod"
-				save_setting network ppp_mtu "$FORM_ppp_mtu"
-
-				save_setting network wan_ifname "ppp0"
-		
-				case "$FORM_ppp_redial" in
-					demand)
-						save_setting network ppp_demand 1
-						;;
-					persist)
-						save_setting network ppp_demand ""
-						;;
-				esac	
-			;;
-			*)
-				wan_ifname=${wan_ifname:-$(nvram get wan_ifname)}
-				[ -z "$wan_ifname" -o "${wan_ifname%%[0-9]*}" = "ppp" ] && {
-					wan_device=${wan_device:-$(nvram get wan_device)}
-					wan_device=${wan_device:-vlan1}
-					save_setting network wan_ifname "$wan_device"
-				}
-			;;
-		esac
-	}
-fi
-
-# detect pptp package and compile option
-[ -x /sbin/ifup.pptp ] && {
-	PPTP_OPTION="option|pptp|PPTP"
-	PPTP_SERVER_OPTION="field|PPTP Server IP|pptp_server|hidden
-text|pptp_server_ip|$FORM_pptp_server_ip"
-}
-[ -x /sbin/ifup.pppoe ] && {
-	PPPOE_OPTION="option|pppoe|PPPoE"
-}
-
-
-header "Network" "WAN" "@TR<>" ' onLoad="modechange()" ' "$SCRIPT_NAME"
-
-cat <
-
-EOF
-
-display_form <>
-field|@TR<>
-select|wan_proto|$FORM_wan_proto
-option|none|@TR<>
-option|dhcp|@TR<>
-option|static|@TR<>
-$PPPOE_OPTION
-$PPTP_OPTION
-helplink|http://wiki.openwrt.org/OpenWrtDocs/Configuration#head-b62c144b9886b221e0c4b870edb0dd23a7b6acab
-end_form
-start_form|@TR<>|ip_settings|hidden
-field|@TR<>|ipaddr|hidden
-text|wan_ipaddr|$FORM_wan_ipaddr
-field|@TR<>|netmask|hidden
-text|wan_netmask|$FORM_wan_netmask
-field|@TR<>|gateway|hidden
-text|wan_gateway|$FORM_wan_gateway
-$PPTP_SERVER_OPTION
-helpitem|IP Settings
-helptext|Helptext IP Settings#IP Settings are optional for DHCP and PPTP. If you set them, they are used as defaults in case the DHCP server is unavailable.
-end_form
-start_form|@TR<>|dns|hidden
-listedit|dns|$SCRIPT_NAME?wan_proto=static&|$FORM_dns|$FORM_dnsadd
-helpitem|Note
-helptext|Helptext DNS save#You should save your settings on this page before adding/removing DNS servers
-end_form
-
-start_form|@TR<>|ppp_settings|hidden
-field|@TR<>|redial|hidden
-select|ppp_redial|$FORM_ppp_redial
-option|demand|@TR<>
-option|persist|@TR<>
-field|@TR<>|demand_idletime|hidden
-text|ppp_idletime|$FORM_ppp_idletime
-helpitem|Maximum Idle Time
-helptext|Helptext Idle Time#The number of seconds without internet traffic that the router should wait before disconnecting from the Internet (Connect on Demand only)
-field|@TR<>|persist_redialperiod|hidden
-text|ppp_redialperiod|$FORM_ppp_redialperiod
-helpitem|Redial Timeout
-helptext|Helptext Redial Timeout#The number of seconds to wait after receiving no response from the provider before trying to reconnect
-field|@TR<>|username|hidden
-text|ppp_username|$FORM_ppp_username
-field|@TR<>|passwd|hidden
-password|ppp_passwd|$FORM_ppp_passwd
-field|@TR<>|mtu|hidden
-text|ppp_mtu|$FORM_ppp_mtu
-end_form
-EOF
-
-footer ?>
-
diff --git a/openwrt/package/webif/files/www/cgi-bin/webif/wireless-advanced.sh b/openwrt/package/webif/files/www/cgi-bin/webif/wireless-advanced.sh
deleted file mode 100755
index 7a096c8b74..0000000000
--- a/openwrt/package/webif/files/www/cgi-bin/webif/wireless-advanced.sh
+++ /dev/null
@@ -1,104 +0,0 @@
-#!/usr/bin/webif-page
->" ' onLoad="modechange()"' "$SCRIPT_NAME"
-
-cat <
-
-EOF
-
-display_form <>
-listedit|wds|$SCRIPT_NAME?|$FORM_wds|$FORM_wdsadd
-end_form
-start_form|@TR<>
-listedit|maclist|$SCRIPT_NAME?|$FORM_maclist|$FORM_maclistadd
-end_form
-start_form|@TR<>
-field|@TR<>
-select|lazywds|$FORM_lazywds
-option|1|@TR<>
-option|0|@TR<>
-field|@TR<>
-text|wdstimeout|$FORM_wdstimeout
-field|@TR<>:
-select|macmode|$FORM_macmode
-option|disabled|@TR<>
-option|allow|@TR<>
-option|deny|@TR<>
-field|@TR<>:
-select|antdiv|$FORM_antdiv
-option|-1|@TR<>
-option|0|@TR<>
-option|1|@TR<>
-option|3|@TR<>
-field|@TR<>
-text|distance|$FORM_distance
-end_form
-EOF
-
-footer ?>
-
diff --git a/openwrt/package/webif/files/www/cgi-bin/webif/wireless-config.sh b/openwrt/package/webif/files/www/cgi-bin/webif/wireless-config.sh
deleted file mode 100755
index 6709098fe2..0000000000
--- a/openwrt/package/webif/files/www/cgi-bin/webif/wireless-config.sh
+++ /dev/null
@@ -1,290 +0,0 @@
-#!/usr/bin/webif-page
->"
-for ch in $CHANNELS; do
-	F_CHANNELS="${F_CHANNELS}
-option|$ch"
-done
-
-if empty "$FORM_submit"; then
-	FORM_mode=${wl0_mode:-$(nvram get wl0_mode)}
-	infra=${wl0_infra:-$(nvram get wl0_infra)}
-	case "$infra" in
-		0|off|disabled) FORM_mode=adhoc;;
-	esac
-	FORM_radio=${wl0_radio:-$(nvram get wl0_radio)}
-	case "$FORM_radio" in
-		0|off|diabled) FORM_radio=0;;
-		*) FORM_radio=1;;
-	esac
-			
-	FORM_ssid=${wl0_ssid:-$(nvram get wl0_ssid)}
-	FORM_broadcast=${wl0_closed:-$(nvram get wl0_closed)}
-	case "$FORM_broadcast" in
-		1|off|disabled) FORM_broadcast=1;;
-		*) FORM_broadcast=0;;
-	esac
-	FORM_channel=${wl0_channel:-$(nvram get wl0_channel)}
-	FORM_encryption=off
-	akm=${wl0_akm:-$(nvram get wl0_akm)}
-	case "$akm" in
-		psk)
-			FORM_encryption=psk
-			FORM_wpa1=wpa1
-			;;
-		psk2)
-			FORM_encryption=psk
-			FORM_wpa2=wpa2
-			;;
-		'psk psk2')
-			FORM_encryption=psk
-			FORM_wpa1=wpa1
-			FORM_wpa2=wpa2
-			;;
-		wpa)
-			FORM_encryption=wpa
-			FORM_wpa1=wpa1
-			;;
-		wpa2)
-			FORM_encryption=wpa
-			FORM_wpa2=wpa2
-			;;
-		'wpa wpa2')
-			FORM_encryption=wpa
-			FORM_wpa1=wpa1
-			FORM_wpa2=wpa2
-			;;
-		*)
-			FORM_wpa1=wpa1
-			;;
-	esac
-	FORM_wpa_psk=${wl0_wpa_psk:-$(nvram get wl0_wpa_psk)}
-	FORM_radius_key=${wl0_radius_key:-$(nvram get wl0_radius_key)}
-	FORM_radius_ipaddr=${wl0_radius_ipaddr:-$(nvram get wl0_radius_ipaddr)}
-	crypto=${wl0_crypto:-$(nvram get wl0_crypto)}
-	case "$crypto" in
-		tkip)
-			FORM_tkip=tkip
-			;;
-		aes)
-			FORM_aes=aes
-			;;
-		'tkip+aes'|'aes+tkip')
-			FORM_aes=aes
-			FORM_tkip=tkip
-			;;
-		*)
-			FORM_tkip=tkip
-			;;
-	esac
-	equal "$FORM_encryption" "off" && {
-		wep=${wl0_wep:-$(nvram get wl0_wep)}
-		case "$wep" in
-			1|enabled|on) FORM_encryption=wep;;
-			*) FORM_encryption=off;;
-		esac
-	}
-	FORM_key1=${wl0_key1:-$(nvram get wl0_key1)}
-	FORM_key2=${wl0_key2:-$(nvram get wl0_key2)}
-	FORM_key3=${wl0_key3:-$(nvram get wl0_key3)}
-	FORM_key4=${wl0_key4:-$(nvram get wl0_key4)}
-	key=${wl0_key:-$(nvram get wl0_key)}
-	FORM_key=${key:-1}
-else
-	SAVED=1
-	case "$FORM_encryption" in
-		wpa) V_RADIUS="
-string|FORM_radius_key|@TR<>|min=4 max=63 required|$FORM_radius_key
-ip|FORM_radius_ipaddr|@TR<>|required|$FORM_radius_ipaddr";;
-		psk) V_PSK="wpapsk|FORM_wpa_psk|@TR<>|required|$FORM_wpa_psk";;
-		wep) V_WEP="
-int|FORM_key|@TR<>|min=1 max=4|$FORM_key
-wep|FORM_key1|@TR<> 1||$FORM_key1
-wep|FORM_key2|@TR<> 2||$FORM_key2
-wep|FORM_key3|@TR<> 3||$FORM_key3
-wep|FORM_key4|@TR<> 4||$FORM_key4";;
-	esac
-
-	validate <>|required|$FORM_ssid
-int|FORM_channel|@TR<>|required min=0 max=$CHANNEL_MAX|$FORM_channel
-$V_WEP
-$V_RADIUS
-$V_PSK
-EOF
-	equal "$?" 0 && {
-		save_setting wireless wl0_radio "$FORM_radio"
-
-		if equal "$FORM_mode" adhoc; then
-			FORM_mode=sta
-			infra="0"
-		fi
-		save_setting wireless wl0_mode "$FORM_mode"
-		save_setting wireless wl0_infra ${infra:-1}
-			
-		save_setting wireless wl0_ssid "$FORM_ssid"
-		save_setting wireless wl0_closed "$FORM_broadcast"
-		save_setting wireless wl0_channel "$FORM_channel"
-	
-		crypto=""
-		equal "$FORM_aes" aes && crypto="aes"
-		equal "$FORM_tkip" tkip && crypto="tkip${crypto:++$crypto}"
-		save_setting wireless wl0_crypto "$crypto"
-
-		case "$FORM_encryption" in
-			psk)
-				case "${FORM_wpa1}${FORM_wpa2}" in
-					wpa1) save_setting wireless wl0_akm "psk";;
-					wpa2) save_setting wireless wl0_akm "psk2";;
-					wpa1wpa2) save_setting wireless wl0_akm "psk psk2";;
-				esac
-				save_setting wireless wl0_wpa_psk "$FORM_wpa_psk"
-				save_setting wireless wl0_wep "disabled"
-				;;
-			wpa)
-				case "${FORM_wpa1}${FORM_wpa2}" in
-					wpa1) save_setting wireless wl0_akm "wpa";;
-					wpa2) save_setting wireless wl0_akm "wpa2";;
-					wpa1wpa2) save_setting wireless wl0_akm "wpa wpa2";;
-				esac
-				save_setting wireless wl0_radius_ipaddr "$FORM_radius_ipaddr"
-				save_setting wireless wl0_radius_key "$FORM_radius_key"
-				save_setting wireless wl0_wep "disabled"
-				;;
-			wep)
-				save_setting wireless wl0_wep enabled
-				save_setting wireless wl0_akm "none"
-				save_setting wireless wl0_key1 "$FORM_key1"
-				save_setting wireless wl0_key2 "$FORM_key2"
-				save_setting wireless wl0_key3 "$FORM_key3"
-				save_setting wireless wl0_key4 "$FORM_key4"
-				save_setting wireless wl0_key "$FORM_key"
-				;;
-			off)
-				save_setting wireless wl0_akm "none"
-				save_setting wireless wl0_wep disabled
-				;;
-		esac
-	}
-fi
-
-header "Network" "Wireless" "@TR<>" ' onLoad="modechange()" ' "$SCRIPT_NAME"
-
-cat <
-
-
-EOF
-
-display_form <>
-field|@TR<>
-select|radio|$FORM_radio
-option|1|@TR<>
-option|0|@TR<>
-field|@TR<>
-select|broadcast|$FORM_broadcast
-option|0|@TR<>
-option|1|@TR<>
-field|@TR<>
-text|ssid|$FORM_ssid
-helpitem|ESSID
-helptext|Helptext ESSID#Name of your Wireless Network
-field|@TR<>
-select|channel|$FORM_channel
-$F_CHANNELS
-field|@TR<>
-select|mode|$FORM_mode
-option|ap|@TR<>
-option|sta|@TR<>
-option|wet|@TR<> (@TR<>)
-option|adhoc|@TR<>
-helpitem|WLAN Mode#Mode
-helptext|Helptext Operation mode#This sets the operation mode of your wireless network. Selecting 'Client (Bridge)' will not change your network interface settings. It will only set some parameters in the wireless driver that allow for limited bridging of the interface.
-helplink|http://wiki.openwrt.org/OpenWrtDocs/Configuration#head-7126c5958e237d603674b3a9739c9d23bdfdb293
-end_form
-start_form|@TR<>
-field|@TR<>
-select|encryption|$FORM_encryption
-option|off|@TR<>
-option|wep|WEP
-option|psk|WPA (@TR<>)
-option|wpa|WPA (RADIUS)
-helpitem|Encryption Type
-helptext|Helptext Encryption Type#'WPA (RADIUS)' is only supported in Access Point mode. 
'WPA (PSK)' doesn't work in Ad-Hoc mode. -field|@TR<>|wpa_support|hidden -checkbox|wpa1|$FORM_wpa1|wpa1|WPA1 -checkbox|wpa2|$FORM_wpa2|wpa2|WPA2 -field|@TR<>|wpa_crypto|hidden -checkbox|tkip|$FORM_tkip|tkip|RC4 (TKIP) -checkbox|aes|$FORM_aes|aes|AES -field|WPA @TR<>|wpapsk|hidden -text|wpa_psk|$FORM_wpa_psk -field|@TR<>|radius_ip|hidden -text|radius_ipaddr|$FORM_radius_ipaddr -field|@TR<>|radiuskey|hidden -text|radius_key|$FORM_radius_key -field|@TR<>|wep_keys|hidden -radio|key|$FORM_key|1 -text|key1|$FORM_key1|
-radio|key|$FORM_key|2 -text|key2|$FORM_key2|
-radio|key|$FORM_key|3 -text|key3|$FORM_key3|
-radio|key|$FORM_key|4 -text|key4|$FORM_key4|
-end_form -EOF - -footer ?> - diff --git a/openwrt/package/webif/files/www/cgi-bin/webif/wireless-status.sh b/openwrt/package/webif/files/www/cgi-bin/webif/wireless-status.sh deleted file mode 100755 index 47c044efaf..0000000000 --- a/openwrt/package/webif/files/www/cgi-bin/webif/wireless-status.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/usr/bin/webif-page ->" -?> - -
&1 | grep -v 'no wireless' | grep '\w' ?>
- - -