Add --dry-run to the weekly health check

Lets the email be read before it is sent, which matters for a message whose whole
job is to be clear at a glance a week from now.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
Waters Church
2026-10-08 09:39:31 -04:00
co-authored by Claude Opus 5
parent 8db4b5bb02
commit 672accc6a1
+10
View File
@@ -15,6 +15,11 @@
set -uo pipefail
# --dry-run prints the email instead of sending it. Useful for reading what it will say
# before a week goes by, and for checking the wording without filling an inbox.
DRY=0
[ "${1:-}" = "--dry-run" ] && DRY=1
ROOT="$(cd "$(dirname "$0")/.." && pwd)"
NAS_HOST="10.1.1.5"
NAS_USER="Christian"
@@ -122,5 +127,10 @@ $LINES
MSG
fi
if [ "$DRY" = 1 ]; then
printf 'Subject: %s\n\n' "$SUBJECT"
cat "$BODY_FILE"
else
node "$ROOT/scripts/alert.js" "$SUBJECT" "$(cat "$BODY_FILE")"
fi
rm -f "$BODY_FILE"