Consolidate config into sky-cam.conf; systemd failure notifications
sky-cam.conf (new) - Single file replaces mattermost_config.txt reference, notify_config.txt, and the hardcoded BASE_DIR/MUSIC_DIR/TIMEZONE scattered across scripts - Bash-sourceable and Python key=value readable (same format) All .sh scripts - source sky-cam.conf at startup; BASE_DIR / MUSIC_DIR from config sunrise2mm.py - Reads sky-cam.conf relative to script location; no hardcoded path notify.sh - Sources sky-cam.conf; Mattermost credentials come from there directly, no separate mattermost_config.txt lookup needed systemd/sky-cam-notify-failure@.service (new) - Template unit called by OnFailure= in each service - Sends notification via notify.sh when any sky-cam job fails - All three .service units now have OnFailure=sky-cam-notify-failure@%n.service Removed: notify_config.txt, sky-cam.crontab (superseded) https://claude.ai/code/session_01C4jbd3waXG3eKZYbGUjLUQ
This commit is contained in:
+2
-1
@@ -13,6 +13,7 @@
|
||||
set -euo pipefail
|
||||
|
||||
SCRIPT_DIR="$(dirname "$(realpath "$0")")"
|
||||
source "$SCRIPT_DIR/sky-cam.conf"
|
||||
|
||||
ASTRO_YEAR="${1:-}"
|
||||
if [ -z "$ASTRO_YEAR" ]; then
|
||||
@@ -20,7 +21,7 @@ if [ -z "$ASTRO_YEAR" ]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
base_dir="/home/motion/drives/local-2tb"
|
||||
base_dir="$BASE_DIR"
|
||||
script_name=$(basename "$SCRIPT_DIR" | cut -d'-' -f1)
|
||||
year_dir="$base_dir/movies/$script_name/$ASTRO_YEAR"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user