mirror of
https://github.com/alexanderepstein/Bash-Snippets
synced 2018-11-08 02:59:35 +01:00
Adding check internet to crypt for update call
This commit is contained in:
parent
e92dbe8aa4
commit
2f007ecb1d
@ -15,6 +15,11 @@ checkOpenSSL()
|
|||||||
fi
|
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
|
## This function determines which http get tool the system has installed and returns an error if there isnt one
|
||||||
getConfiguredClient()
|
getConfiguredClient()
|
||||||
{
|
{
|
||||||
@ -170,7 +175,8 @@ if [[ $# == 0 ]]; then
|
|||||||
exit 0
|
exit 0
|
||||||
elif [[ $1 == "update" ]]; then
|
elif [[ $1 == "update" ]]; then
|
||||||
getConfiguredClient || exit 1
|
getConfiguredClient || exit 1
|
||||||
update
|
checkInternet || exit 1
|
||||||
|
update || exit 1
|
||||||
exit 0
|
exit 0
|
||||||
elif [[ $1 == "help" ]]; then
|
elif [[ $1 == "help" ]]; then
|
||||||
usage
|
usage
|
||||||
|
Loading…
Reference in New Issue
Block a user