Repository files, collaboration, releases and project activity.
archforge-external-status / apply-monitor-fix.shmain
▤ apply-monitor-fix.sh1045 bytes
13 lines · Select a line number for a permalink
1
#!/usr/bin/env bash2
# Deploy the ArchForge-sourced external website redirect monitoring fix, without3
# resetting the database, admin account, secrets, or Caddy configuration.4
set -Eeuo pipefail5
[[ $EUID -eq 0 ]] || { echo '[ERROR] Run as root: sudo bash ./apply-monitor-fix.sh' >&2;exit 1; }6
ROOT=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd)7
[[ -r "$ROOT/package.json" && -r "$ROOT/src/probes.js" ]] || { echo '[ERROR] Not an ArchForge External Status source checkout.' >&2;exit 1; }8
/usr/bin/node -e 'const p=require(process.argv[1]);if(p.version!=="1.0.4")process.exit(1)' "$ROOT/package.json" || { echo '[ERROR] Expected v1.0.4 source. Run git pull --ff-only first.' >&2;exit 1; }9
echo '[*] Deploying v1.0.4 from your ArchForge checkout; backup and rollback are handled by deploy.sh.'10
bash "$ROOT/scripts/deploy.sh" "$ROOT"11
printf '\n[OK] Updated code deployed. The monitor needs two successful checks to close a confirmed outage (usually about two minutes).\n'12
printf ' Previous measurements and incident history are retained.\n'