From c111c1a23ecfbfa3dcb5bcacb027a5cb4cdd5e78 Mon Sep 17 00:00:00 2001 From: Skylar Grant Date: Tue, 8 Oct 2024 21:31:20 -0400 Subject: [PATCH] Fix how NAS gets mounted to be more generic --- ingest-mac.sh | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/ingest-mac.sh b/ingest-mac.sh index 247bd20..775809c 100755 --- a/ingest-mac.sh +++ b/ingest-mac.sh @@ -42,8 +42,9 @@ SD_MOUNT_POINT[1]="/Volumes/Untitled" # Drone declare -a SD_SRC_PATH SD_SRC_PATH[0]="/DCIM/100MSDCF" # Camera SD_SRC_PATH[1]="/DCIM/100MEDIA" # Drone -# NAS Network Address -NAS_ADDRESS="//GUEST:@192.168.0.2/media" +# NAS Mount address as found with `mount` +NAS_ADDRESS="//voidf1sh@voidNAS" +declare NAS_MOUNT_POINT # Will be set later # Folder where ingests are stored on the Mac declare -a MAC_INGEST_FOLDER @@ -147,10 +148,10 @@ check_sd() { check_nas() { if mount | grep -q "$NAS_ADDRESS"; then # Get the NAS mount point since it can vary - NAS_MOUNT_POINT=$(mount | grep "$NAS_ADDRESS" | awk '{print $3}' | grep -E '^/Volumes/media(-1)?$') + NAS_MOUNT_POINT=$(mount | grep "$NAS_ADDRESS" | awk '{print $3}' | grep -E '^/[^/]+') + echo "NAS Mounted at $NAS_MOUNT_POINT." else echo "ERR: NAS Not mounted!" - exit 1 fi } @@ -252,6 +253,7 @@ ingest_nas() { fi echo "Beginning copy..." echo "Syncing ingested images with NAS..." + echo "Debug: NAS_MOUNT_POINT inside function: $NAS_MOUNT_POINT" echo "Source: ${MAC_INGEST_FOLDER[$INGEST_MODE]}/" echo "Destination: $NAS_MOUNT_POINT${NAS_INGEST_FOLDER[$INGEST_MODE]}/" echo "Press any key to continue..." @@ -268,6 +270,7 @@ ingest_nas() { ###################################################################################### check_sd +check_nas ###################################################################################### # Mode Prompt @@ -291,7 +294,8 @@ while true; do echo "" echo "Ingest Source Path: ${SD_MOUNT_POINT[$INGEST_MODE]}${SD_SRC_PATH[$INGEST_MODE]}" echo "Mac Ingest Path: $MAC_INGEST_PATH" - echo "NAS Ingest Path: $NAS_MOUNT_POINT$NAS_INGEST_PATH" + echo "NAS Mount Path: $NAS_MOUNT_POINT" + echo "NAS Ingest Path: $NAS_INGEST_PATH" echo "" echo "Please enter an option from below:" echo ""