dotfiles/config/polybar/scripts/network/interfaces.sh

18 lines
319 B
Bash
Raw Normal View History

2023-02-06 17:56:36 -05:00
#! /bin/bash
wireless="wlan0"
lan="lan0"
wup=$(ethtool $wireless 2>/dev/null| grep -oP "Link detected:.*")
lup=$(ethtool $lan 2>/dev/null| grep -oP "Link detected:.*")
for i in "$wireless" "$lan";
do
echo "$wup" | grep "yes"
#if [ $(echo "$wup" | grep "yes") = "" ];
if [ "$wup" = "" ];
then
echo 1
fi;
done;