Test internet connection
-run scripts only if internet is ok
This commit is contained in:
@@ -152,6 +152,13 @@ get_info_pkg() {
|
||||
|
||||
echo -e "${bold}🍺 Homebrew ${reset}"
|
||||
|
||||
curl -Is http://www.google.com | head -1 | grep 200 1>/dev/null
|
||||
if [[ $? -eq 1 ]]; then
|
||||
echo -e "\n${red}No Internet connection !${reset}"
|
||||
echo -e "Exit !"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo -e "\n🍺 ${underline}Updating brew...${reset}\n"
|
||||
brew update
|
||||
|
||||
|
||||
@@ -82,6 +82,14 @@ echo -e "\n${underline}🌿 npm:${reset}"
|
||||
echo -e " - current version: ${italic}$npm_v${reset}"
|
||||
echo -e " - install path: ${italic}$npm_ins${reset}"
|
||||
|
||||
|
||||
curl -Is http://www.google.com | head -1 | grep 200 1>/dev/null
|
||||
if [[ $? -eq 1 ]]; then
|
||||
echo -e "\n${red}No Internet connection !${reset}"
|
||||
echo -e "Exit !"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# version installée de nvm par Homebrew
|
||||
# nvm_installed=$(brew info nvm | grep Cellar)
|
||||
|
||||
|
||||
@@ -79,8 +79,8 @@ version=$(php --info | grep 'PHP Version' | sed -n '1p' | awk -F" " '{print $NF}
|
||||
v=${version:0:3}
|
||||
echo -e "${ita_under}${blue}Current PHP version:${reset} ${bold}$version${reset}\n"
|
||||
|
||||
latest="8.0"
|
||||
versions=("7.2" "7.3" "7.4" "8.1" "$latest")
|
||||
latest="8.2"
|
||||
versions=("7.4" "8.0" "8.1" "8.3" "$latest")
|
||||
php_installed=$(ls -1 $(brew --prefix)/opt/ | grep php@)
|
||||
echo -e "${ita_under}${blue}Installed PHP versions:${reset}"
|
||||
echo -e "$php_installed\n"
|
||||
@@ -94,6 +94,12 @@ fi
|
||||
pecl version
|
||||
|
||||
|
||||
curl -Is http://www.google.com | head -1 | grep 200
|
||||
if [[ $? -eq 1 ]]; then
|
||||
echo -e "\n${red}No Internet connection !${reset}"
|
||||
echo -e "Exit !"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Note that all public channels can be synced using "update-channels"
|
||||
echo -e "\n${ita_under}${blue}Updating all channels...${reset}"
|
||||
|
||||
@@ -16,6 +16,20 @@ display_info=true
|
||||
# Also add module for prevent to update it.
|
||||
declare -a do_not_update=('')
|
||||
|
||||
italic="\033[3m"
|
||||
underline="\033[4m"
|
||||
ita_under="\033[3;4m"
|
||||
bgd="\033[1;4;31m"
|
||||
red="\033[1;31m"
|
||||
bold="\033[1m"
|
||||
bold_ita="\033[1;3m"
|
||||
box="\033[1;41m"
|
||||
redbold="\033[1;31m"
|
||||
redbox="\033[1;41m"
|
||||
reset="\033[0m"
|
||||
|
||||
echo -e "${bold}🐪 Perl ${reset}"
|
||||
echo
|
||||
|
||||
perl_app=$(which perl)
|
||||
perl_v=$(perl -v | sed -n '2p')
|
||||
@@ -42,8 +56,15 @@ else
|
||||
install_ok=true
|
||||
fi
|
||||
|
||||
|
||||
curl -Is http://www.google.com | head -1 | grep 200 1>/dev/null
|
||||
if [[ $? -eq 1 ]]; then
|
||||
echo -e "\n${red}No Internet connection !${reset}"
|
||||
echo -e "Exit !"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ "$install_ok" == "true" ]; then
|
||||
echo "$module installed"
|
||||
|
||||
# install with cpan
|
||||
# % cpan-outdated | xargs cpan -i
|
||||
|
||||
@@ -78,6 +78,13 @@ if (( ${#do_not_update[@]} )); then
|
||||
fi
|
||||
|
||||
|
||||
curl -Is http://www.google.com | head -1 | grep 200 1>/dev/null
|
||||
if [[ $? -eq 1 ]]; then
|
||||
echo -e "\n${red}No Internet connection !${reset}"
|
||||
echo -e "Exit !"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
#Packages update
|
||||
echo -e "🐍 ${underline}Search for packages update...${reset}\n"
|
||||
|
||||
|
||||
@@ -40,6 +40,13 @@ list=$(pipx list --include-injected)
|
||||
echo -e "\n${underline}List installed packages:${reset}"
|
||||
echo "$list"
|
||||
|
||||
curl -Is http://www.google.com | head -1 | grep 200 1>/dev/null
|
||||
if [[ $? -eq 1 ]]; then
|
||||
echo -e "\n${red}No Internet connection !${reset}"
|
||||
echo -e "Exit !"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
pipx-outdated() {
|
||||
echo -e "\n${underline}Outdated Packages:${reset}"
|
||||
while read -sr pyPkgName pyPkyVersion; do
|
||||
|
||||
@@ -11,6 +11,13 @@ reset="\033[0m"
|
||||
|
||||
echo -e "\n${bold}🦀 Rust${reset}\n"
|
||||
|
||||
curl -Is http://www.google.com | head -1 | grep 200 1>/dev/null
|
||||
if [[ $? -eq 1 ]]; then
|
||||
echo -e "\n${red}No Internet connection !${reset}"
|
||||
echo -e "Exit !"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if hash rustup 2>/dev/null; then
|
||||
|
||||
echo -e "🦀 ${underline}rustup check${reset}\n"
|
||||
|
||||
@@ -40,8 +40,15 @@ elif [[ "$OSTYPE" == "linux_gnu" ]]; then
|
||||
elif [[ "$OSTYPE" == "linux_gnueabihf" ]]; then
|
||||
v=$HOME/venv
|
||||
fi
|
||||
#
|
||||
###############################################################################################
|
||||
|
||||
curl -Is http://www.google.com | head -1 | grep 200 1>/dev/null
|
||||
if [[ $? -eq 1 ]]; then
|
||||
echo -e "\n${red}No Internet connection !${reset}"
|
||||
echo -e "Exit !"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
################################################################################################
|
||||
|
||||
for app in ${apps[*]}
|
||||
do
|
||||
|
||||
Reference in New Issue
Block a user