-
Notifications
You must be signed in to change notification settings - Fork 0
/
check-goychat.sh
12 lines (12 loc) · 913 Bytes
/
check-goychat.sh
1
2
3
4
5
6
7
8
9
10
11
12
#!/bin/env bash
if /usr/bin/torify /usr/bin/curl -s --head http://vid2x7jyypqblcc4.onion/ | /bin/grep "200 OK" >/dev/null
then
/bin/echo "The HTTPd returned a 200 OK." >/dev/null
/usr/bin/swaks --silent 3 -t [email protected] -f "[email protected]" --header "Subject: Goy.Chat [up]" --body "The tor-wrapper for Goy.Chat is available and healthy." --server mail.domain.tld --auth LOGIN --auth-user "[email protected]" --auth-password "redacted" -tls -p 587
exit 0
else
/bin/echo "The HTTPd isn't returning a healthy reply." >/dev/null
/usr/bin/swaks --silent 3 -t [email protected] -f "[email protected]" --header "Subject: Goy.Chat [down]" --body "The tor-wrapper for Goy.Chat is unavailable — investigate immediately." --server mail.domain.tld --auth LOGIN --auth-user "[email protected]" --auth-password "redacted" -tls -p 587
/usr/bin/curl -s https://domain.tld/goychat-webhook.php
exit 1
fi