dotfiles/bin/nma
2017-08-17 10:13:02 +02:00

11 lines
444 B
Bash
Executable file

#!/bin/bash
out=$(mktemp /tmp/nma.XXXXXXXX)
curl -s -d "apikey=1e9cfe3bddab21f271b742eb04f9918a76ad0ef0333be7d3" -d "application=Server" -d "event=megumi.eeleater.org" --data-urlencode "description=$1" -d "priority=0" "https://www.notifymyandroid.com/publicapi/notify" -o "$out"
if test $(xml sel -t -m "nma/success" -v "@code" "$out") == "200"; then
echo "Sent"
exit 0
fi
echo "Not sent: $(xml sel -t -m "nma/error" -v "." "$out")"
exit 1