lactozora/modules/ntfy.bash
2025-01-27 00:12:03 -06:00

24 lines
451 B
Bash
Executable file

#!/bin/bash
# was split out to a seperate project, but will be pulled in when done
# check for curl
if ! command -v curl &> /dev/null
then
echo "This module needs curl to be installed."
exit
fi
# Function to send a message to a NTFY server
send_ntfy_message() {
local message="$1"
local topic="$2"
ntfyserver="192.168.1.112:83"
local url="http://${ntfyserver}/${topic:-default}"
curl -X POST -d "$message" "$url"
}