#!/bin/sh

if [ "$1" = "-h" ]; then
	echo "Usage: pushover [-e] message"
	exit 0
fi
if [ "$1" = "-e" ]; then
	shift;
	echo "$*"
fi

# Register at pushover.net to get your keys to using Pushover notifications
/usr/bin/curl -sS --connect-timeout 10 --max-time 15 --retry 10 --retry-delay 1 \
	--form-string "token=YOUR-PUSHOVER-TOKEN-HERE" \
	--form-string "user=YOUR-PUSHOVER-USER-HERE" \
	--form-string "message=$*" \
	--output /dev/null \
	https://api.pushover.net/1/messages.json 2>/dev/null &

rc=$?

sleep 0.75

exit $rc
