From d69c0d1dbdc5f000ed7b3f372c57ecae8d74b6f4 Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Wed, 5 Oct 2005 21:26:44 +0000 Subject: [PATCH] add ad-hoc mode in wireless config page SVN-Revision: 2054 --- .../www/cgi-bin/webif/wireless-config.sh | 51 ++++++++++++++----- 1 file changed, 39 insertions(+), 12 deletions(-) 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 index 17d90a763f..d31aa48d8c 100755 --- a/openwrt/package/webif/files/www/cgi-bin/webif/wireless-config.sh +++ b/openwrt/package/webif/files/www/cgi-bin/webif/wireless-config.sh @@ -24,6 +24,11 @@ done if [ -z "$FORM_submit" -o \! -z "$ERROR" ]; 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_ssid=${wl0_ssid:-$(nvram get wl0_ssid)} FORM_channel=${wl0_channel:-$(nvram get wl0_channel)} FORM_encryption=off @@ -102,7 +107,17 @@ 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_ssid|ESSID|required|$FORM_ssid int|FORM_channel|Channel|required min=1 max=$CHANNEL_MAX|$FORM_channel" && { - save_setting wireless wl0_mode "$FORM_mode" + case "$FORM_mode" in + adhoc) + save_setting wireless wl0_mode sta + save_setting wireless wl0_infra 0 + ;; + *) + save_setting wireless wl0_mode "$FORM_mode" + save_setting wireless wl0_infra 1 + ;; + esac + save_setting wireless wl0_ssid "$FORM_ssid" save_setting wireless wl0_channel "$FORM_channel" case "$FORM_aes$FORM_tkip" in @@ -152,6 +167,27 @@ header "Network" "Wireless" "Wireless settings" ' onLoad="modechange()" ' "$SCRI