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:
co-authored by
Claude Opus 5
parent
8db4b5bb02
commit
672accc6a1
@@ -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
|
||||
|
||||
node "$ROOT/scripts/alert.js" "$SUBJECT" "$(cat "$BODY_FILE")"
|
||||
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"
|
||||
|
||||
Reference in New Issue
Block a user