if ($2 != "") print "<div class=\"settings-title\"><h3><strong>" $2 "</strong></h3></div>"
print "<div class=\"settings-content\"><table width=\"100%\" summary=\"Settings\">"
form_help = ""
+ form_help_link = ""
}
$1 ~ /^field/ {
if (field_open == 1) print "</td></tr>"
else radio_selected=""
print "<input id=\"" $2 "_" $4 "\" type=\"radio\" name=\"" $2 "\" value=\"" $4 "\" " radio_selected $6 " />"
}
+($1 != "") && ($1 !~ /^option/) {
+ select_open = 0
+ print "</select>"
+}
+$1 ~ /^select/ {
+ print "<select id=\"" $2 "\" name=\"" $2 "\">"
+ select_open = 1
+ select_default = $3
+}
+($1 ~ /^option/) && (select_open == 1) {
+ if ($2 == select_default) option_selected=" selected=\"selected\""
+ else option_selected=""
+ if ($3 != "") option_title = $3
+ else option_title = $2
+ print "<option" option_selected " value=\"" $2 "\">" option_title "</option>"
+}
$1 ~ /^text/ { print "<input id=\"" $2 "\" type=\"text\" name=\"" $2 "\" value=\"" $3 "\" />" $4 }
$1 ~ /^submit/ { print "<input type=\"submit\" name=\"" $2 "\" value=\"" $3 "\" />" }
$1 ~ /^helpitem/ { form_help = form_help "<dt>" $2 ":</dt>" }
}
FORM_submit=""
}
+CC=${wl0_country_code:-$(nvram get wl0_country_code)}
+case "$CC" in
+ All|all|ALL) CHANNELS="1 2 3 4 5 6 7 8 9 10 11 12 13 14"; CHANNEL_MAX=14 ;;
+ *) CHANNELS="1 2 3 4 5 6 7 8 9 10 11"; CHANNEL_MAX=11 ;;
+esac
+F_CHANNELS=""
+for ch in $CHANNELS; do
+ F_CHANNELS="${F_CHANNELS}option|$ch
+"
+done
+
if [ -z "$FORM_submit" ]; then
FORM_newmac=${FORM_newmac:-00:00:00:00:00:00}
FORM_mode=${wl0_mode:-$(nvram get wl0_mode)}
FORM_ssid=${wl0_ssid:-$(nvram get wl0_ssid)}
+ FORM_channel=${wl0_channel:-$(nvram get wl0_channel)}
FORM_encryption=off
akm=${wl0_akm:-$(nvram get wl0_akm)}
case "$akm" in
wep|FORM_key3|WEP key 3||$FORM_key3
wep|FORM_key4|WEP key 4||$FORM_key4
string|FORM_wpa_psk|WPA pre-shared key|min=8 max=63 $V_PSK|$FORM_wpa_psk
-string|FORM_radius_key|RADIUS server key|min=4 max=63 $V_RADIUS|$FORM_radius_key" && {
+string|FORM_radius_key|RADIUS server key|min=4 max=63 $V_RADIUS|$FORM_radius_key
+string|FORM_ssid|ESSID|required|$FORM_ssid
+int|FORM_channel|Channel|required min=1 max=$CHANNEL_MAX|$FORM_channel" && {
save_setting wireless wl0_mode "$FORM_mode"
save_setting wireless wl0_ssid "$FORM_ssid"
+ save_setting wireless wl0_channel "$FORM_channel"
case "$FORM_aes$FORM_tkip" in
aes) save_setting wireless wl0_crypto aes;;
tkip) save_setting wireless wl0_crypto tkip;;
text|ssid|$FORM_ssid
helpitem|ESSID
helptext|Name of your Wireless Network
+field|Channel
+select|channel|$FORM_channel
+$F_CHANNELS
field|Mode
radio|mode|$FORM_mode|ap|Access Point<br />|onChange=\"modechange()\"
radio|mode|$FORM_mode|sta|Client <br />|onChange=\"modechange()\"
radio|mode|$FORM_mode|wet|Bridge|onChange=\"modechange()\"
helpitem|Mode
helptext|Operation mode
-helplink|http://www.google.com
+helplink|http://wiki.openwrt.org/OpenWrtDocs/Configuration#head-7126c5958e237d603674b3a9739c9d23bdfdb293
end_form
start_form|Encryption settings
field|Encryption type