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