diff --git a/update.sh b/update.sh index 469b6ec6..ed87dc6c 100755 --- a/update.sh +++ b/update.sh @@ -1,14 +1,5 @@ #!/bin/bash -echo -en "Checking internet connection... " -timeout 1 bash -c "echo >/dev/tcp/8.8.8.8/53" -if [[ $? != 0 ]]; then - echo -e "\e[31mfailed\e[0m" - exit 1 -else - echo -e "\e[32mOK\e[0m" -fi - if [[ -z $(which curl) ]]; then echo "Cannot find curl, exiting."; exit 1; fi if [[ -z $(which docker-compose) ]]; then echo "Cannot find docker-compose, exiting."; exit 1; fi if [[ -z $(which docker) ]]; then echo "Cannot find docker, exiting."; exit 1; fi @@ -16,6 +7,15 @@ if [[ -z $(which git) ]]; then echo "Cannot find git, exiting."; exit 1; fi if [[ -z $(which awk) ]]; then echo "Cannot find awk, exiting."; exit 1; fi if [[ -z $(which sha1sum) ]]; then echo "Cannot find sha1sum, exiting."; exit 1; fi +echo -en "Checking internet connection... " +curl -o /dev/null google.com -sm3 +if [[ $? != 0 ]]; then + echo -e "\e[31mfailed\e[0m" + exit 1 +else + echo -e "\e[32mOK\e[0m" +fi + set -o pipefail export LC_ALL=C DATE=$(date +%Y-%m-%d_%H_%M_%S)