about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorCharadon <dev@iotib.net>2022-09-30 09:50:13 -0400
committerCharadon <dev@iotib.net>2022-09-30 09:50:13 -0400
commit8d09a34ce2bdd01cc66c7510202b53bf3cc0e2ac (patch)
tree522fde46fd2f66be36847177562979280d4a7f0b
parent76fc13726ee58808bcd28091bf45e3a6cde14c79 (diff)
downloaddscip-8d09a34ce2bdd01cc66c7510202b53bf3cc0e2ac.tar.gz
dscip: Added check to see if update.sh exists, if not, continue. (Mainly for packaging)
-rwxr-xr-xdscip29
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
 
 ################################################################################