FollieHiyuki-dotfiles/home/.local/bin/info/ssid
2021-02-13 19:28:59 +03:00

26 lines
510 B
Bash
Executable File

#!/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"