From 8d36016c32d701b23cdfceb31aca493150b572a3 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Mon, 8 Feb 2010 10:35:01 -0800 Subject: examples/init.sh: reenable set -u This may be used as a basis of other scripts so we need to stash $1 before we "set -u" --- examples/init.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/examples/init.sh b/examples/init.sh index 35ec896..aa6463b 100644 --- a/examples/init.sh +++ b/examples/init.sh @@ -8,6 +8,8 @@ APP_ROOT=/home/x/my_app/current PID=$APP_ROOT/tmp/pids/unicorn.pid CMD="/usr/bin/unicorn -D -c $APP_ROOT/config/unicorn.rb" INIT_CONF=$APP_ROOT/config/init.conf +action="$1" +set -u test -f "$INIT_CONF" && . $INIT_CONF @@ -23,7 +25,7 @@ oldsig () { test -s $old_pid && kill -$1 `cat $old_pid` } -case $1 in +case $action in start) sig 0 && echo >&2 "Already running" && exit 0 $CMD -- cgit v1.2.3-24-ge0c7