21 lines
459 B
Bash
Executable File
21 lines
459 B
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
disconnect1="/"
|
|
disconnect2="\\"
|
|
wconnected=""
|
|
econnected=""
|
|
|
|
id="$(ip link | awk '/state UP/ {print $2}')"
|
|
|
|
while true; do
|
|
if ping -c 1 archlabslinux.com >/dev/null 2>&1 || ping -c 1 archlinux.org >/dev/null 2>&1; then
|
|
[[ $id == e* ]] && echo "$econnected" || echo "$wconnected"
|
|
sleep 25
|
|
else
|
|
echo "$disconnect1" # /
|
|
sleep 0.6
|
|
echo "$disconnect2" # \
|
|
sleep 0.6
|
|
fi
|
|
done
|