Merge pull request #46 from outis1one/clDemoe/seasonal-sunrise-montage-nn268
4-seasons: add optional date argument
This commit is contained in:
+9
-2
@@ -14,10 +14,13 @@ source "$SCRIPT_DIR/sky-cam.conf"
|
||||
export TIMEZONE # make it visible to season_info.py subprocess
|
||||
|
||||
# Camera name: required first argument (systemd passes it via ExecStart).
|
||||
# Date: optional second argument (YYYY-MM-DD); defaults to yesterday.
|
||||
CAM_NAME="${1:-}"
|
||||
DATE_ARG="${2:-}"
|
||||
if [ -z "$CAM_NAME" ]; then
|
||||
echo "Usage: $0 <camera-name>"
|
||||
echo " e.g. $0 east or $0 north"
|
||||
echo "Usage: $0 <camera-name> [YYYY-MM-DD]"
|
||||
echo " e.g. $0 east"
|
||||
echo " $0 east 2026-04-20"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
@@ -27,7 +30,11 @@ music_base_dir="$MUSIC_DIR"
|
||||
[ ! -d "$music_base_dir" ] && music_base_dir="$SCRIPT_DIR/music"
|
||||
|
||||
# ── Date setup ────────────────────────────────────────────────────────────────
|
||||
if [ -n "$DATE_ARG" ]; then
|
||||
yesterday=$(date --date="$DATE_ARG" +%Y-%m-%d)
|
||||
else
|
||||
yesterday=$(date --date="yesterday" +%Y-%m-%d)
|
||||
fi
|
||||
echo "Processing: $yesterday"
|
||||
|
||||
# ── Season / movement info from astronomical calculation ──────────────────────
|
||||
|
||||
Reference in New Issue
Block a user