initial commit
This commit is contained in:
22
wifi
Executable file
22
wifi
Executable file
@@ -0,0 +1,22 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
if [[ ! -d /sys/class/net/${interface}/wireless ]] || [[ "$(cat /sys/class/net/$interface/operstate)" = "down" ]];
|
||||
then exit
|
||||
fi
|
||||
|
||||
DATA=$(grep $interface /proc/net/wireless)
|
||||
IFS=" " read -r -a DATA <<< "$DATA"
|
||||
QUALITY=$(echo "${DATA[2]}*100/70" | bc)
|
||||
echo "$QUALITY%"
|
||||
echo "$QUALITY%"
|
||||
|
||||
if [[ $QUALITY -ge 80 ]]; then
|
||||
echo "#98971a"
|
||||
elif [[ $QUALITY -lt 80 ]]; then
|
||||
echo "#D79921"
|
||||
elif [[ $QUALITY -lt 60 ]]; then
|
||||
echo "#FFAE00"
|
||||
elif [[ $QUALITY -lt 40 ]]; then
|
||||
echo "#FF0000"
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user