From 67d299d8adac04df575c2dc27dfb9d9e8a9919f7 Mon Sep 17 00:00:00 2001 From: Jane Alesi Date: Mon, 16 Mar 2026 10:54:30 +0100 Subject: [PATCH] feat(scripts): add morning health check and daily routine scripts --- scripts/daily-routine.sh | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/scripts/daily-routine.sh b/scripts/daily-routine.sh index 29e0cc6..f221d4f 100755 --- a/scripts/daily-routine.sh +++ b/scripts/daily-routine.sh @@ -11,10 +11,14 @@ echo "--- Starting Daily Routine $(date) ---" | tee -a "$LOCAL_LOG" # Phase 0: Health check echo "[Phase 0/6] Running health check..." | tee -a "$LOCAL_LOG" if [ -x "$HEALTH_SCRIPT" ]; then - if ! bash "$HEALTH_SCRIPT" 2>&1 | tee -a "$LOCAL_LOG"; then - echo " CRITICAL: Exiting daily routine" | tee -a "$LOCAL_LOG" +HEALTH_EXIT=0 +bash "$HEALTH_SCRIPT" 2>&1 | tee -a "$LOCAL_LOG" || HEALTH_EXIT=$? +if [ "$HEALTH_EXIT" -eq 2 ]; then +echo " CRITICAL: Exiting daily routine" | tee -a "$LOCAL_LOG" exit 2 - fi +elif [ "$HEALTH_EXIT" -eq 1 ]; then + echo " WARNING: Proceeding with warnings" | tee -a "$LOCAL_LOG" +fi else echo " WARNING: health check script not found" | tee -a "$LOCAL_LOG" fi