From 8d09a34ce2bdd01cc66c7510202b53bf3cc0e2ac Mon Sep 17 00:00:00 2001 From: Charadon Date: Fri, 30 Sep 2022 09:50:13 -0400 Subject: dscip: Added check to see if update.sh exists, if not, continue. (Mainly for packaging) --- dscip | 29 +++++++++++++++++------------ 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/dscip b/dscip index 8532b9f..6a03785 100755 --- a/dscip +++ b/dscip @@ -24,19 +24,24 @@ cd "$(dirname "$0")" . "$(pwd -P)/config.sh" # Checking updates -if [ "$DSCIP_AUTO_UPDATE" = "true" ]; then - . "$WORKING_DIRECTORY/update.sh" - DSCIP_NEW_CKSUM="$(cksum "$0")" - # Rerun dscip if update was found. - if [ ! "$DSCIP_CKSUM" = "$DSCIP_NEW_CKSUM" ]; then - echo "[dscip] Update found. Rerunning DSCIP..." - "$SHELL" "$0" "$@" - exit 0 - else - echo "[dscip] No updates found. Continuing..." - fi +if [ -f "$WORKING_DIRECTORY/update.sh" ]; +then + if [ "$DSCIP_AUTO_UPDATE" = "true" ]; then + . "$WORKING_DIRECTORY/update.sh" + DSCIP_NEW_CKSUM="$(cksum "$0")" + # Rerun dscip if update was found. + if [ ! "$DSCIP_CKSUM" = "$DSCIP_NEW_CKSUM" ]; then + echo "[dscip] Update found. Rerunning DSCIP..." + "$SHELL" "$0" "$@" + exit 0 + else + echo "[dscip] No updates found. Continuing..." + fi + else + echo "[dscip] Auto updates turned off. Continuing..." + fi else - echo "[dscip] Auto updates turned off. Continuing..." + echo "[dscip] Update script doesn't exist. Continuing..." fi ################################################################################ -- cgit 1.4.1-2-gfad0