mirror of
https://git.disroot.org/FollieHiyuki/dotfiles.git
synced 2024-12-02 04:08:30 -05:00
26 lines
510 B
Plaintext
26 lines
510 B
Plaintext
|
#!/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"
|