Use curl for internet connection check, fixes #399
parent
112e056fda
commit
716573520f
18
update.sh
18
update.sh
|
@ -1,14 +1,5 @@
|
||||||
#!/bin/bash
|
#!/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 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-compose) ]]; then echo "Cannot find docker-compose, exiting."; exit 1; fi
|
||||||
if [[ -z $(which docker) ]]; then echo "Cannot find docker, 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 awk) ]]; then echo "Cannot find awk, exiting."; exit 1; fi
|
||||||
if [[ -z $(which sha1sum) ]]; then echo "Cannot find sha1sum, 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
|
set -o pipefail
|
||||||
export LC_ALL=C
|
export LC_ALL=C
|
||||||
DATE=$(date +%Y-%m-%d_%H_%M_%S)
|
DATE=$(date +%Y-%m-%d_%H_%M_%S)
|
||||||
|
|
Loading…
Reference in New Issue