Created
January 10, 2024 19:06
-
-
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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