check NAS mount before running

This commit is contained in:
2026-07-28 07:17:43 -07:00
parent bb4700f4a8
commit d858d7e40b

View File

@@ -4,7 +4,8 @@ set -euo pipefail
OUTPUT_SOURCE="$HOME/ComfyUI/output"
VIDEO_SOURCE="$HOME/ComfyUI/videos"
AUDIO_SOURCE="$HOME/ComfyUI/output/audio"
SHARE_DIR="/mini.nas/miniShare1/Pictures"
NAS_MOUNT="/mini.nas/miniShare1"
SHARE_DIR="$NAS_MOUNT/Pictures"
STATE_FILE="$HOME/.local/state/comfyui-sync.state"
NEATCLI="$(command -v /home/linuxbrew/.linuxbrew/bin/neatcli || true)"
RENAME_SCRIPT="$HOME/git/schmeeve-toolz/rename-ai-snaps"
@@ -17,6 +18,19 @@ if [ ! -d "$SHARE_DIR" ]; then
exit 1
fi
if ! mountpoint -q "$NAS_MOUNT"; then
echo "[comfyui-sync] $NAS_MOUNT is not mounted, attempting to mount..."
if ! sudo -n mount "$NAS_MOUNT" 2>&1; then
echo "[comfyui-sync] ERROR: mount attempt failed"
exit 1
fi
if ! mountpoint -q "$NAS_MOUNT"; then
echo "[comfyui-sync] ERROR: $NAS_MOUNT still not mounted after mount attempt, refusing to copy locally"
exit 1
fi
echo "[comfyui-sync] Mount succeeded."
fi
echo "[comfyui-sync] Starting at $(date)"
current_files=$( {