Failure detection for curl

This commit is contained in:
Michael Stanclift 2020-05-29 20:53:28 -05:00
parent a6de8d21f0
commit 0b3653fe2d

View File

@ -890,8 +890,13 @@ function show_version {
MESSAGE="Running Version: ${VERSION}"
echo_info
GITVERSION=$(curl -s https://raw.githubusercontent.com/vmstan/gravity-sync/master/VERSION)
MESSAGE="Latest Version: ${GITVERSION}"
GITVERSION=$(curl -sf https://raw.githubusercontent.com/vmstan/gravity-sync/master/VERSION)
if [ -z "$GITVERSION" ]
then
MESSAGE="Latest Version: Unable to Check"
else
MESSAGE="Latest Version: ${GITVERSION}"
fi
echo_info
}