chore(fleet): sync operator memory, hatch menu dialogs, and watchdog alerts
This commit is contained in:
@@ -12,11 +12,24 @@
|
||||
# - New failures: print each new "relaunch FAILED" line, update the
|
||||
# watermark to the newest line, exit 1.
|
||||
#
|
||||
# Self-contained: no arguments, no nested quoting. Safe to call from cron
|
||||
# or from the box CLI.
|
||||
# --no-advance: peek-only read. New failures are printed (same output and
|
||||
# exit codes as above) but the watermark is NOT advanced. The web
|
||||
# surface (via `box-ctl watchdog-alerts --no-advance`) should always
|
||||
# pass this flag so UI polling never churns the watermark out from
|
||||
# under the CLI. CLI runs without the flag keep advance-on-read.
|
||||
#
|
||||
# Self-contained: safe to call from cron or from the box CLI.
|
||||
|
||||
set -u
|
||||
|
||||
NO_ADVANCE=0
|
||||
for arg in "$@"; do
|
||||
case "$arg" in
|
||||
--no-advance) NO_ADVANCE=1 ;;
|
||||
*) echo "watchdog-alert-check.sh: unknown argument: $arg" >&2; exit 2 ;;
|
||||
esac
|
||||
done
|
||||
|
||||
LOG="/home/super/Projects/NetVM/chromebox-watchdog.log"
|
||||
WATERMARK="/home/super/Projects/NetVM/watchdog-alert-watermark.txt"
|
||||
|
||||
@@ -48,7 +61,10 @@ fi
|
||||
|
||||
[ "${#new_lines[@]}" -gt 0 ] || exit 0
|
||||
|
||||
# Report new failures and advance the watermark to the newest line.
|
||||
# Report new failures and advance the watermark to the newest line
|
||||
# (skipped in --no-advance peek mode).
|
||||
printf '%s\n' "${new_lines[@]}"
|
||||
printf '%s\n' "${failed[-1]}" > "$WATERMARK"
|
||||
if [ "$NO_ADVANCE" -eq 0 ]; then
|
||||
printf '%s\n' "${failed[-1]}" > "$WATERMARK"
|
||||
fi
|
||||
exit 1
|
||||
|
||||
Reference in New Issue
Block a user