2017-12-01 00:21:33 -06:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
2018-02-16 07:44:07 -06:00
|
|
|
disconnected="/"
|
2018-02-26 05:25:52 -06:00
|
|
|
disconnected2="\\"
|
|
|
|
wireless_connected=""
|
2018-02-16 07:44:07 -06:00
|
|
|
ethernet_connected=""
|
2017-12-05 21:50:28 -06:00
|
|
|
|
2017-12-01 00:21:33 -06:00
|
|
|
while true; do
|
2018-03-02 04:25:45 -06:00
|
|
|
if ping -c1 8.8.8.8 &>/dev/null; then
|
2018-02-26 05:25:52 -06:00
|
|
|
ID=$(ip link | awk '/state UP/ {print $2}')
|
2018-02-26 23:01:09 -06:00
|
|
|
if [[ $ID == e* ]]; then
|
2018-02-26 05:25:52 -06:00
|
|
|
echo "$ethernet_connected" ; sleep 10
|
2018-02-16 07:44:07 -06:00
|
|
|
else
|
2018-02-26 05:25:52 -06:00
|
|
|
echo "$wireless_connected" ; sleep 10
|
2018-02-16 07:44:07 -06:00
|
|
|
fi
|
2017-12-07 22:20:42 -06:00
|
|
|
else
|
2018-02-26 05:25:52 -06:00
|
|
|
echo "$disconnected" ; sleep 0.6
|
|
|
|
echo "$disconnected2" ; sleep 0.6
|
2017-12-07 22:20:42 -06:00
|
|
|
fi
|
2017-12-01 00:21:33 -06:00
|
|
|
done
|