FollieHiyuki-dotfiles/home/.local/bin/info/ssid

26 lines
510 B
Plaintext
Raw Normal View History

2021-02-13 11:28:59 -05:00
#!/bin/sh
eth="enp2s0"
wlan="wlp4s0"
ethstate=$(ip addr | grep "$eth:" | awk '{print $9}')
wlanstate=$(ip addr | grep "$wlan:" | awk '{print $9}')
if [ "$ethstate" = "DOWN" ]
then
ethernet=" x"
else
# stat=$(ifstat)
# etx=$(echo "$stat" | grep "$eth" | awk '{print $9}')
# erx=$(echo "$stat" | grep "$eth" | awk '{print $7}')
ethernet=" "
fi
if [ "$wlanstate" = "DOWN" ]
then
wifi="睊 x"
else
ssid=$(iwgetid | cut -d \" -f2)
wifi="直 $ssid"
fi
echo "$ethernet|$wifi"