Move mount checks to appropriate sections
This commit is contained in:
parent
b693f153ea
commit
aac1bc5c88
@ -133,6 +133,27 @@ create_folders_mac() {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Check if the SD card is mounted
|
||||||
|
check_sd() {
|
||||||
|
if mount | grep -q "${SD_MOUNT_POINT[$INGEST_MODE]}"; then
|
||||||
|
touch /tmp/mounted
|
||||||
|
else
|
||||||
|
echo "ERR: SD Card Not mounted!"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
# Check if the NAS is mounted
|
||||||
|
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)?$')
|
||||||
|
else
|
||||||
|
echo "ERR: NAS Not mounted!"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
# Cleanup images on camera SD.
|
# Cleanup images on camera SD.
|
||||||
# TODO: Update this for the new combined script
|
# TODO: Update this for the new combined script
|
||||||
clean_sd() {
|
clean_sd() {
|
||||||
@ -223,6 +244,7 @@ ingest_mac() {
|
|||||||
|
|
||||||
# Mac->NAS Sync
|
# Mac->NAS Sync
|
||||||
ingest_nas() {
|
ingest_nas() {
|
||||||
|
check_nas
|
||||||
local dry_run=""
|
local dry_run=""
|
||||||
# Detect if dry run
|
# Detect if dry run
|
||||||
if [[ $1 -eq 1 ]]; then
|
if [[ $1 -eq 1 ]]; then
|
||||||
@ -245,22 +267,7 @@ ingest_nas() {
|
|||||||
# Check for Connections
|
# Check for Connections
|
||||||
######################################################################################
|
######################################################################################
|
||||||
|
|
||||||
# Check if the SD card is mounted
|
check_sd
|
||||||
if mount | grep -q "${SD_MOUNT_POINT[$INGEST_MODE]}"; then
|
|
||||||
touch /tmp/mounted
|
|
||||||
else
|
|
||||||
echo "ERR: SD Card Not mounted!"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Check if the NAS is mounted
|
|
||||||
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)?$')
|
|
||||||
else
|
|
||||||
echo "ERR: NAS Not mounted!"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
######################################################################################
|
######################################################################################
|
||||||
# Mode Prompt
|
# Mode Prompt
|
||||||
@ -322,8 +329,7 @@ while true; do
|
|||||||
4)
|
4)
|
||||||
# !! Delete ALL media on SD card!!
|
# !! Delete ALL media on SD card!!
|
||||||
clear
|
clear
|
||||||
# clean_sd
|
clean_sd
|
||||||
echo "Untested and not working yet!"
|
|
||||||
;;
|
;;
|
||||||
5)
|
5)
|
||||||
# !! Delete ALL ingested media on Mac!!
|
# !! Delete ALL ingested media on Mac!!
|
||||||
|
Loading…
Reference in New Issue
Block a user