Files
vps-oracle-jp/uptime-check.sh
T
Gan, Jimmy 55a8dbc457
Deploy / lint (push) Failing after 0s
Deploy / security (push) Failing after 1s
Deploy / deploy (push) Has been skipped
Add VPS hardening, Tailscale exit node, and uptime check scripts
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-03 02:55:05 +08:00

36 lines
959 B
Bash

#!/bin/bash
# Simple Uptime & Service Health Check for VPS
# Checks Xray, AdGuard Home, Tailscale, and WireGuard
SERVICES=("xray" "AdGuardHome" "tailscaled" "wg-quick@wg0")
echo "--- Service Health Check ($(date)) ---"
for svc in "${SERVICES[@]}"; do
if systemctl is-active --quiet "$svc"; then
echo "[OK] $svc is running"
else
echo "[ERROR] $svc is NOT running!"
# Optional: Attempt restart
# sudo systemctl restart "$svc"
fi
done
# Check if Xray is listening on 443
if ss -tuln | grep -q ":443 "; then
echo "[OK] Port 443 is listening (Xray)"
else
echo "[ERROR] Port 443 is NOT listening!"
fi
# Check if AdGuard Home is listening on 53 (Tailscale IP)
TAILSCALE_IP="100.70.115.1"
if ss -tuln | grep -q "$TAILSCALE_IP:53 "; then
echo "[OK] AdGuard Home is listening on $TAILSCALE_IP:53"
else
echo "[WARNING] AdGuard Home is NOT listening on $TAILSCALE_IP:53"
fi
echo "--- Check Complete ---"