You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

92 lines
2.9KB

  1. #!/bin/bash
  2. red=`tput setaf 1`
  3. green=`tput setaf 2`
  4. reset=`tput sgr0`
  5. # Colors for an interactive output.
  6. if [[ $EUID -ne 0 ]]; then
  7. echo -e "${red}"
  8. echo -e "This script must be run as root\n\n"
  9. echo -e "${reset}"
  10. exit 1
  11. fi
  12. # Confirming that the script is only run by root and not by any other user.
  13. curl -Is https://dms-git.ameyo.net:8265/
  14. if [[ $? -ne 0 ]]; then
  15. echo -e "${red}"
  16. echo -e "\ndms.git.ameyo.net:8265 is not reachable. Exiting the script.\n"
  17. echo -e "${reset}"
  18. exit 1
  19. else
  20. echo -e "${green}"
  21. echo -e "\ndms.git.ameyo.net:8265 is reachable. Proceeding further.\n"
  22. echo -e "${reset}"
  23. curl -Is https://vault.centos.org/
  24. if [[ $? -ne 0 ]]; then
  25. echo -e "${red}"
  26. echo -e "\nvault.centos.org is not reachable. Exiting the script.\n"
  27. echo -e "${reset}"
  28. exit 1
  29. else
  30. echo -e "${green}"
  31. echo -e "\nvault.centos.org is reachable. Proceeding further.\n"
  32. echo -e "${reset}"
  33. curl -Is https://buildlogs.centos.org/
  34. if [[ $? -ne 0 ]]; then
  35. echo -e "${red}"
  36. echo -e "\nbuildlogs.centos.org is not reachable. Exiting the script.\n"
  37. echo -e "${reset}"
  38. exit 1
  39. else
  40. echo -e "${green}"
  41. echo -e "\nbuildlogs.centos.org is reachable. Proceeding further.\n"
  42. echo -e "${reset}"
  43. curl -Is https://download.fedoraproject.org/
  44. if [[ $? -ne 0 ]]; then
  45. echo -e "${red}"
  46. echo -e "\ndownload.fedoraproject.org is not reachable. Exiting the script.\n"
  47. echo -e "${reset}"
  48. exit 1
  49. else
  50. echo -e "${green}"
  51. echo -e "\ndownload.fedoraproject.org is reachable. Proceeding further.\n"
  52. echo -e "${reset}"
  53. curl -Is https://raw.githubusercontent.com/
  54. if [[ $? -ne 0 ]]; then
  55. echo -e "${red}"
  56. echo -e "\nraw.githubusercontent.com is not reachable. Exiting the script.\n"
  57. echo -e "${reset}"
  58. exit 1
  59. else
  60. echo -e "${green}"
  61. echo -e "\nraw.githubusercontent.com is reachable. Proceeding further.\n"
  62. echo -e "${reset}"
  63. curl -Is https://yum.oracle.com/
  64. if [[ $? -ne 0 ]]; then
  65. echo -e "${red}"
  66. echo -e "\nyum.oracle.com is not reachable. Exiting the script.\n"
  67. echo -e "${reset}"
  68. exit 1
  69. else
  70. echo -e "${green}"
  71. echo -e "\nyum.oracle.com is reachable. Proceeding further.\n"
  72. echo -e "${reset}"
  73. curl -Is https://mirrors.ircam.fr/
  74. if [[ $? -ne 0 ]]; then
  75. echo -e "${red}"
  76. echo -e "\nmirrors.ircam.fr is not reachable. Exiting the script.\n"
  77. echo -e "${reset}"
  78. exit 1
  79. else
  80. echo -e "${green}"
  81. echo -e "\nmirrors.ircam.fr is reachable. Proceeding further.\n"
  82. echo -e "${reset}"
  83. fi
  84. fi
  85. fi
  86. fi
  87. fi
  88. fi
  89. fi