UNPKG

457 Bapplication/x-shView Raw
1#!/usr/bin/env bash
2
3if [[ -z "$@" ]]; then
4 echo "usage: $0 [cmd...]"
5 exit 1
6fi
7
8GROWL_NOTIFY="$(dirname $0)/growl-notify.sh"
9
10notify () {
11 $GROWL_NOTIFY "$@" >/dev/null &
12}
13
14notify "{\"text\":\"$PROJECT_NAME\",\"options\":{\"label\":\"success\",\"title\":\"+ service started\"}}"
15echo "$@"
16$@
17STATUS_CODE=$?
18notify "{\"text\":\"$PROJECT_NAME\",\"options\":{\"label\":\"error\",\"title\":\"- service exit ($STATUS_CODE)\"}}"
19
20sleep 1
21exit $STATUS_CODE