summary refs log tree commit homepage
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2010-02-08 10:35:01 -0800
committerEric Wong <normalperson@yhbt.net>2010-02-08 10:35:01 -0800
commit8d36016c32d701b23cdfceb31aca493150b572a3 (patch)
tree2c6715403478bc0ac209c1af82c2ca6088e4eb15
parentf5cbae120faf5f216e352f8a23184baf6029c72d (diff)
This may be used as a basis of other scripts so we need
to stash $1 before we "set -u"
-rw-r--r--examples/init.sh4
1 files changed, 3 insertions, 1 deletions
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