27 lines
622 B
Bash
27 lines
622 B
Bash
|
#!/bin/bash
|
||
|
|
||
|
function scanWifi()
|
||
|
{
|
||
|
local ifcace=$1
|
||
|
iwconfig ${iface} scan
|
||
|
}
|
||
|
|
||
|
function connectBoard()
|
||
|
{
|
||
|
uci delete wireless.@wifi-iface[1]
|
||
|
uci add wireless wifi-iface
|
||
|
uci set wireless.@wifi-iface[1].network="EmlidReach"
|
||
|
uci set wireless.@wifi-iface[1].ssid="Base1:2a:03"
|
||
|
uci set wireless.@wifi-iface[1].encryption="psk2"
|
||
|
uci set wireless.@wifi-iface[1].device="radio1"
|
||
|
uci set wireless.@wifi-iface[1].mode="sta"
|
||
|
uci set wireless.@wifi-iface[1].bssid="FC:DB:B3:7E:2A:03"
|
||
|
uci set wireless.@wifi-iface[1].key="basepyxis"
|
||
|
uci commit
|
||
|
reload_config
|
||
|
sleep 15
|
||
|
udhcpc -i wlan1
|
||
|
}
|
||
|
|
||
|
cells=$(scanWifi wlan1)
|