helm/os/arch/.config/panel/lemons/wifi.sh

15 lines
477 B
Bash
Raw Normal View History

2016-10-19 07:56:37 -07:00
#!/usr/bin/env bash
2016-11-02 16:58:47 -07:00
# No wifi interface? Abort!
ints=$(awk -F "/" 'FNR==NR { wire[$5]++; next } { split(FILENAME, state, "/"); if (state[5] in wire && $1 == "up") print state[5] }' <(find /sys/class/net/*/wireless -type d) $(find /sys/class/net/*/operstate ! -type d))
[ -z "$ints" ] && echo "Ix" && exit
2016-10-31 19:07:23 -07:00
2016-11-02 16:58:47 -07:00
# Start watching
2016-10-19 07:56:37 -07:00
while :
do
2016-10-31 19:07:23 -07:00
signal=$(awk 'NR==3 {print $3}' /proc/net/wireless)
echo "I${signal%?}"
# echo "I${signal%?},$(iwgetid --raw)"
2016-10-19 07:56:37 -07:00
sleep 5
2016-10-31 19:07:23 -07:00
done