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