diff --git a/comfyui-sync b/comfyui-sync index 210fdbe..8c41220 100755 --- a/comfyui-sync +++ b/comfyui-sync @@ -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=$( {