about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMunyoki Kilyungi2025-05-10 09:24:55 +0300
committerMunyoki Kilyungi2025-05-10 09:24:55 +0300
commit6c603686b693fcf297ff364fe68e689e74c238a7 (patch)
treebbc76e6be392c2777983c8a96e7354f876d96754
parent41b6c49a908248eff1999e198dfe64f1f1f7036b (diff)
downloadgn-machines-6c603686b693fcf297ff364fe68e689e74c238a7.tar.gz
Skip if file already exists.
-rwxr-xr-xgenenetwork-local-container.sh26
1 files changed, 14 insertions, 12 deletions
diff --git a/genenetwork-local-container.sh b/genenetwork-local-container.sh
index e805611..5827d56 100755
--- a/genenetwork-local-container.sh
+++ b/genenetwork-local-container.sh
@@ -320,19 +320,21 @@ init_sql() {
 	fi
     done
 
-    # Download the file
-    log INFO "Downloading $URL to $DOWNLOAD_DIR/$FILE_NAME"
-    if ! wget -O "$DOWNLOAD_DIR/$FILE_NAME" "$URL"; then
-	log ERROR "Failed to download $URL"
-	exit 1
-    fi
-
     # Extract the .xz file
-    log INFO "Extracting $DOWNLOAD_DIR/$FILE_NAME"
-    if ! xz -d "$DOWNLOAD_DIR/$FILE_NAME"; then
-	log ERROR "Failed to extract $DOWNLOAD_DIR/$FILE_NAME"
-	rm -f "$DOWNLOAD_DIR/$FILE_NAME"
-	exit 1
+    if [ ! -f "/tmp/db_webqtl_s-2025-02-18.sql" ]; then
+       # Download the file
+       log INFO "Downloading $URL to $DOWNLOAD_DIR/$FILE_NAME"
+       if ! wget -O "$DOWNLOAD_DIR/$FILE_NAME" "$URL"; then
+	   log ERROR "Failed to download $URL"
+	   exit 1
+       fi
+
+       log INFO "Extracting $DOWNLOAD_DIR/$FILE_NAME"
+       if ! xz -d "$DOWNLOAD_DIR/$FILE_NAME"; then
+	   log ERROR "Failed to extract $DOWNLOAD_DIR/$FILE_NAME"
+	   rm -f "$DOWNLOAD_DIR/$FILE_NAME"
+	   exit 1
+       fi
     fi
 
     # Prepare MySQL user and password credentials