diff options
author | doc <doc@filenotfound.org> | 2025-06-30 20:11:52 +0000 |
---|---|---|
committer | doc <doc@filenotfound.org> | 2025-06-30 20:11:52 +0000 |
commit | 41e897f4945aaf8fbcdf0b12ac2f08c5e6ae0458 (patch) | |
tree | db7c3520fd91abc3cf56b1a52095d23f3a80d059 /check_services.sh |
Diffstat (limited to 'check_services.sh')
-rwxr-xr-x | check_services.sh | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/check_services.sh b/check_services.sh new file mode 100755 index 0000000..3d32937 --- /dev/null +++ b/check_services.sh @@ -0,0 +1,22 @@ +#!/bin/bash +# check_services.sh – outputs JSON for frontend status page + +check_ping() { + ping -c1 -W1 "$1" >/dev/null 2>&1 && echo "online" || echo "offline" +} + +check_tcp() { + nc -z -w 2 "$1" "$2" >/dev/null 2>&1 && echo "online" || echo "offline" +} + +TEAMTALK_STATUS=$(check_tcp tt.themediahub.org 10442) +DA_STATUS=$(check_tcp da.genesishostingtechnologies.com 2222) +SHREDDER_STATUS=$(check_ping shredder.sshjunkie.com) + +cat <<EOF +{ + "teamtalk": "$TEAMTALK_STATUS", + "directadmin": "$DA_STATUS", + "shredder": "$SHREDDER_STATUS" +} +EOF |