Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

add support for generic GET webhook uri #66

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions cloudflare-template.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,19 @@ sitename="" # Title of site "Example Sit
slackchannel="" # Slack Channel #example
slackuri="" # URI for Slack WebHook "https://hooks.slack.com/services/xxxxx"
discorduri="" # URI for Discord WebHook "https://discordapp.com/api/webhooks/xxxxx"
healthchecksiouri="" # URI for healthchecks.io webhook (or any generic webhook to hit with a GET request)

###########################################
## Register a trap to hit the healthcheck endpoint when set
###########################################
do_healthcheck() {
RC=$?
# Only hit the healthcheck uri when we are going to exit status=0; else don't hit the endpoint, which will eventually cause an alarm
if [[ -n "$healthchecksiouri" && "$RC" == "0" ]]; then
curl -s -S -o /dev/null $healthchecksiouri
fi
}
trap do_healthcheck EXIT

###########################################
## Check if we have a public IP
Expand Down