Skip to content

Instantly share code, notes, and snippets.

@syncip
Created January 10, 2024 19:06
Show Gist options
  • Save syncip/a55e22022588abd8c800c546b67c77ce to your computer and use it in GitHub Desktop.
Save syncip/a55e22022588abd8c800c546b67c77ce to your computer and use it in GitHub Desktop.
Prüfen ob ntfy läuft und korrekt Nachrichten empfängt und sendet
#!/bin/bash
link="https://ntfy.XXX.com/upcheck"
# uuid generieren
uuid="$(uuidgen)"
# Nachricht senden
/bin/curl -s -w 5 -d "${uuid}" ${link} > /dev/null
# Nachrichten der letzten 2 Minuten abrufen
data="$( /bin/curl -w 5 -s ${link}/raw?poll=1&since=1m )"
# uuid suchen
if [[ "$data" == *"$uuid"* ]]; then
echo "true"
else
echo "false"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment