diff --git a/.gitattributes b/.gitattributes index b9e7de6..8e43562 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,3 +1,4 @@ files/sasl_passwd filter=git-crypt diff=git-crypt files/borgmatic.yaml filter=git-crypt diff=git-crypt files/zfs-scrub.sh filter=git-crypt diff=git-crypt +files/status.benpro.fr.sh filter=git-crypt diff=git-crypt diff --git a/files/status.benpro.fr.sh b/files/status.benpro.fr.sh new file mode 100644 index 0000000..74c7ac6 Binary files /dev/null and b/files/status.benpro.fr.sh differ diff --git a/files/status.benpro.fr.sh_clear b/files/status.benpro.fr.sh_clear new file mode 100644 index 0000000..8d8efce --- /dev/null +++ b/files/status.benpro.fr.sh_clear @@ -0,0 +1,6 @@ +#!/usr/bin/env bash +set -euo pipefail +latency="$(ping -c 5 uptime.benpro.fr | awk '{print $4}' | tail -1 | cut -d'/' -f2) ms" +URI="https://status.benpro.fr/api/push/?msg=OK&ping=${latency}" + +/usr/bin/curl -s -o /dev/null "$URI" diff --git a/setup-base.py b/setup-base.py index 8c26776..e3b7ac9 100644 --- a/setup-base.py +++ b/setup-base.py @@ -107,3 +107,12 @@ files.put( mode='700', ) +files.put( + name='Add status.benpro.fr.sh', + src='files/status.benpro.fr.sh', + dest='/usr/local/bin/status.benpro.fr.sh', + user='root', + group='root', + mode='700', +) +