All paths into sky-cam.conf; install.sh generates systemd units

sky-cam.conf
- Add SCRIPT_DIR (install location) and CAM_NAME (camera/folder name)
- These are the only values that change when deploying to a new machine

install.sh (new)
- Sources sky-cam.conf, generates all systemd .service and .timer units
  with correct ExecStart paths, then enables and starts the timers
- Run once after editing sky-cam.conf; run again if paths change
- Supports --system flag for system-wide install

All .sh scripts + sunrise2mm.py
- No hardcoded paths remain
- script_name=$(basename ...) derivation replaced by $CAM_NAME from conf
- sunrise_video.10s.sh now sources sky-cam.conf for BASE_DIR, CAM_NAME,
  and SCRIPT_DIR (replaces all /home/motion/... references)
- sunrise2mm.py builds video path from BASE_DIR + CAM_NAME in conf

systemd/ template files kept as reference but no longer need editing

https://claude.ai/code/session_01C4jbd3waXG3eKZYbGUjLUQ
This commit is contained in:
Claude
2026-04-18 21:31:26 +00:00
parent ac01c05948
commit 5d3ee97df0
8 changed files with 151 additions and 33 deletions
+4 -6
View File
@@ -8,7 +8,7 @@
# The 12 individual movement videos already carry their own attribution overlay
# (first 6 seconds of each), so no extra card is appended here.
#
# Output: $base_dir/movies/$script_name/$ASTRO_YEAR/$script_name-$ASTRO_YEAR.mp4
# Output: $BASE_DIR/movies/$CAM_NAME/$ASTRO_YEAR/$CAM_NAME-$ASTRO_YEAR.mp4
set -euo pipefail
@@ -21,9 +21,7 @@ if [ -z "$ASTRO_YEAR" ]; then
exit 1
fi
base_dir="$BASE_DIR"
script_name=$(basename "$SCRIPT_DIR" | cut -d'-' -f1)
year_dir="$base_dir/movies/$script_name/$ASTRO_YEAR"
year_dir="$BASE_DIR/movies/$CAM_NAME/$ASTRO_YEAR"
echo "Assembling Four Seasons $ASTRO_YEAR from $year_dir ..."
@@ -60,7 +58,7 @@ if [ "$missing" -gt 0 ]; then
fi
# ── Join ──────────────────────────────────────────────────────────────────────
output_file="$year_dir/${script_name}-${ASTRO_YEAR}.mp4"
output_file="$year_dir/${CAM_NAME}-${ASTRO_YEAR}.mp4"
echo "Output: $output_file"
ffmpeg -loglevel warning \
@@ -74,5 +72,5 @@ echo "Done: $output_file (${total_min} min)"
# ── Notify ────────────────────────────────────────────────────────────────────
"$SCRIPT_DIR/notify.sh" \
"Four Seasons $ASTRO_YEAR complete" \
"${script_name}-${ASTRO_YEAR}.mp4 — ${total_min} minutes ($found movements)" \
"${CAM_NAME}-${ASTRO_YEAR}.mp4 — ${total_min} minutes ($found movements)" \
|| true