Proxmox/misc/internet-check.sh

14 lines
399 B
Bash
Raw Normal View History

2022-04-24 10:14:46 +02:00
#!/usr/bin/env bash -ex
2022-04-24 10:31:37 +02:00
RD=`echo "\033[01;31m"`
CL=`echo "\033[m"`
GN=`echo "\033[1;92m"`
2022-04-24 10:29:20 +02:00
CM="${GN}${CL}"
CROSS="${RD}${CL}"
2022-04-24 10:14:46 +02:00
wget -q --tries=10 --timeout=5 --spider http://google.com
if [[ $? -eq 0 ]]; then
2022-04-24 10:34:12 +02:00
echo -e " ${CM} Internet Online"
2022-04-24 10:14:46 +02:00
else
2022-04-24 10:34:12 +02:00
echo -e " ${CROSS} Internet Offline"
2022-04-24 10:14:46 +02:00
fi
2022-04-24 10:17:02 +02:00
# bash -c "$(wget -qLO - https://github.com/tteck/Proxmox/raw/main/misc/internet-check.sh)"