Pre-create camera data directories in install.sh

capture.sh creates the per-day subdirectory at runtime, but BASE_DIR/<cam>
and MOVIES_DIR/<cam> need to exist first. Create them during install so the
capture service works immediately on first start without needing a separate
manual mkdir step.

https://claude.ai/code/session_01C4jbd3waXG3eKZYbGUjLUQ
This commit is contained in:
Claude
2026-04-21 16:00:48 +00:00
parent 21463c22fc
commit 5c88b12b9f
+11
View File
@@ -29,6 +29,17 @@ fi
mkdir -p "$UNIT_DIR"
echo "Installing systemd units to $UNIT_DIR ..."
# ── Pre-create data directories for all cameras ───────────────────────────────
echo "Creating data directories..."
for cam in "${CAMERAS[@]}"; do
mkdir -p "$BASE_DIR/$cam"
mkdir -p "$MOVIES_DIR/$cam"
echo " $BASE_DIR/$cam"
echo " $MOVIES_DIR/$cam"
done
mkdir -p "$BASE_DIR/$SUNRISE_CAM"
echo ""
# ── Helper: write a oneshot service unit ─────────────────────────────────────
write_service() {
local unit="$1" description="$2" script="$3" extra="${4:-}"