diff options
author | lassulus <lassulus@googlemail.com> | 2013-05-23 20:12:56 +0200 |
---|---|---|
committer | lassulus <lassulus@googlemail.com> | 2013-05-23 20:12:56 +0200 |
commit | ef5a4dc7b3ca4bfae0f9b470458017a2087f5e90 (patch) | |
tree | 5f4c71addb74565630378cb6eec2a015d99bd6d4 /usr | |
parent | 10842825252fa99b84cb42ad5962713c5f3c7866 (diff) |
wifi settings are now comitted
Diffstat (limited to 'usr')
-rwxr-xr-x | usr/bin/autowifi | 7 |
1 files changed, 6 insertions, 1 deletions
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 "$@" |