From 2f007ecb1d63d06de0ee58cf661ecafec1ea4634 Mon Sep 17 00:00:00 2001 From: Alex Epstein Date: Tue, 1 Aug 2017 22:36:45 -0400 Subject: [PATCH] Adding check internet to crypt for update call --- crypt/crypt | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/crypt/crypt b/crypt/crypt index 84bdb6a..ff41832 100755 --- a/crypt/crypt +++ b/crypt/crypt @@ -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