feat(scripts): add morning health check and daily routine scripts

This commit is contained in:
ja
2026-03-16 10:54:30 +01:00
parent 69d6757d51
commit 67d299d8ad
+7 -3
View File
@@ -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