Browse Source

connectivity.sh

master
kshitizsaini113 2 years ago
parent
commit
d56d0c0b7c
1 changed files with 92 additions and 0 deletions
  1. +92
    -0
      connectivity.sh

+ 92
- 0
connectivity.sh View File

@@ -0,0 +1,92 @@
#!/bin/bash

red=`tput setaf 1`
green=`tput setaf 2`
reset=`tput sgr0`
# Colors for an interactive output.

if [[ $EUID -ne 0 ]]; then
echo -e "${red}"
echo -e "This script must be run as root\n\n"
echo -e "${reset}"
exit 1
fi
# Confirming that the script is only run by root and not by any other user.

curl -Is https://dms-git.ameyo.net:8265/
if [[ $? -ne 0 ]]; then
echo -e "${red}"
echo -e "\ndms.git.ameyo.net:8265 is not reachable. Exiting the script.\n"
echo -e "${reset}"
exit 1
else
echo -e "${green}"
echo -e "\ndms.git.ameyo.net:8265 is reachable. Proceeding further.\n"
echo -e "${reset}"
curl -Is https://vault.centos.org/
if [[ $? -ne 0 ]]; then
echo -e "${red}"
echo -e "\nvault.centos.org is not reachable. Exiting the script.\n"
echo -e "${reset}"
exit 1
else
echo -e "${green}"
echo -e "\nvault.centos.org is reachable. Proceeding further.\n"
echo -e "${reset}"
curl -Is https://buildlogs.centos.org/
if [[ $? -ne 0 ]]; then
echo -e "${red}"
echo -e "\nbuildlogs.centos.org is not reachable. Exiting the script.\n"
echo -e "${reset}"
exit 1
else
echo -e "${green}"
echo -e "\nbuildlogs.centos.org is reachable. Proceeding further.\n"
echo -e "${reset}"
curl -Is https://download.fedoraproject.org/
if [[ $? -ne 0 ]]; then
echo -e "${red}"
echo -e "\ndownload.fedoraproject.org is not reachable. Exiting the script.\n"
echo -e "${reset}"
exit 1
else
echo -e "${green}"
echo -e "\ndownload.fedoraproject.org is reachable. Proceeding further.\n"
echo -e "${reset}"
curl -Is https://raw.githubusercontent.com/
if [[ $? -ne 0 ]]; then
echo -e "${red}"
echo -e "\nraw.githubusercontent.com is not reachable. Exiting the script.\n"
echo -e "${reset}"
exit 1
else
echo -e "${green}"
echo -e "\nraw.githubusercontent.com is reachable. Proceeding further.\n"
echo -e "${reset}"
curl -Is https://yum.oracle.com/
if [[ $? -ne 0 ]]; then
echo -e "${red}"
echo -e "\nyum.oracle.com is not reachable. Exiting the script.\n"
echo -e "${reset}"
exit 1
else
echo -e "${green}"
echo -e "\nyum.oracle.com is reachable. Proceeding further.\n"
echo -e "${reset}"
curl -Is https://mirrors.ircam.fr/
if [[ $? -ne 0 ]]; then
echo -e "${red}"
echo -e "\nmirrors.ircam.fr is not reachable. Exiting the script.\n"
echo -e "${reset}"
exit 1
else
echo -e "${green}"
echo -e "\nmirrors.ircam.fr is reachable. Proceeding further.\n"
echo -e "${reset}"
fi
fi
fi
fi
fi
fi
fi

Loading…
Cancel
Save