feat(scripts): add morning health check and daily routine scripts
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user