From ef5a4dc7b3ca4bfae0f9b470458017a2087f5e90 Mon Sep 17 00:00:00 2001 From: lassulus Date: Thu, 23 May 2013 20:12:56 +0200 Subject: wifi settings are now comitted --- usr/bin/autowifi | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/usr/bin/autowifi b/usr/bin/autowifi index e1528478..8815fb75 100755 --- a/usr/bin/autowifi +++ b/usr/bin/autowifi @@ -1,9 +1,12 @@ #!/bin/sh -x +wifi=wlan0 iface=@wifi-iface[0] radio=$(uci get wireless.${iface}.device) connect_wifi(){ # channel ssid encryption key - ifconfig wlan0 up + uci set wireless.${iface}.mode=sta + + ifconfig $wifi up uci set wireless.${radio}.channel=$1 uci set "wireless.${iface}.ssid=$2" if [ $3 == "none" ] ; then @@ -13,6 +16,8 @@ connect_wifi(){ uci set "wireless.${iface}.key=$4" uci set wireless.${iface}.encryption=$3 fi + uci commit wireless wifi up } + connect_wifi "$@" -- cgit v1.2.3