mirror of
https://github.com/Crocmagnon/ansible.git
synced 2024-12-23 06:21:55 +01:00
12 lines
334 B
Text
12 lines
334 B
Text
|
#!/bin/bash
|
||
|
set -uo pipefail
|
||
|
RID=`uuidgen`
|
||
|
BASE_URL="https://hc-ping.com/{{ healthcheck_webhook_token }}/$1"
|
||
|
START_URL="$BASE_URL/start?rid=$RID"
|
||
|
shift
|
||
|
|
||
|
curl -A "ubuntu-vm" -fsS --retry 5 -o /dev/null $START_URL
|
||
|
logs=$($@ 2>&1)
|
||
|
status=$?
|
||
|
curl -A "ubuntu-vm" -fsS --retry 5 --data-raw "$logs" -o /dev/null "$BASE_URL/$status?rid=$RID"
|