Proxmox/misc/internet-check.sh

14 lines
397 B
Bash
Raw Normal View History

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