diff options
-rwxr-xr-x | dscip | 29 |
1 files 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 ################################################################################ |