shithub: ninethings

ref: 700ffdbbe020d3b547282445f299fdfd1cab46f7
dir: /rc/whi.rc/

View raw version
#!/bin/rc

#knowns=`{awk '$0 ~ /essid/ {split($3, a, "="); print a[2]}' /mnt/factotum/ctl}
knowns=`{awk 'match($0, /essid=.* /) {split(substr($0,RSTART+1,RLENGTH-1),a,"="); print a[2]}' /mnt/factotum/ctl}
ether=ether1
if(~ $#* 1)
	ether=$1

#eval `{kill wpa}

for(k in $knowns){
	if(grep -s $k /net/$ether/ifstats){
		echo '==>' found wireless: $k
		aux/wpa -s $k /net/$ether
	}
}