Adding check internet to crypt for update call

This commit is contained in:
Alex Epstein 2017-08-01 22:36:45 -04:00
parent e92dbe8aa4
commit 2f007ecb1d
1 changed files with 7 additions and 1 deletions

View File

@ -15,6 +15,11 @@ checkOpenSSL()
fi
}
checkInternet()
{
httpGet github.com > /dev/null 2>&1 || { echo "Error: no active internet connection" >&2; return 1; } # query google with a get request
}
## This function determines which http get tool the system has installed and returns an error if there isnt one
getConfiguredClient()
{
@ -170,7 +175,8 @@ if [[ $# == 0 ]]; then
exit 0
elif [[ $1 == "update" ]]; then
getConfiguredClient || exit 1
update
checkInternet || exit 1
update || exit 1
exit 0
elif [[ $1 == "help" ]]; then
usage