UNPKG

345 Bapplication/x-shView Raw
1#!/usr/bin/env bash
2
3echo "growl notify $1"$'\n' >&2
4
5if [[ -z "$1" ]]; then
6 echo "usage: $0 '<json string>'"
7 exit 1
8fi
9
10if [[ -z "$MACHINE_HOST" ]]; then
11 MACHINE_HOST=localhost
12fi
13
14curl --connect-timeout 3 --silent \
15 --header "Content-Type: application/json" --request POST \
16 --data "$1" http://$MACHINE_HOST:23054/notify 2>/dev/null