Wrap arguments for `[ -z` in double quotes

This commit is contained in:
Jacob Vosmaer 2014-09-08 14:25:20 +02:00
parent 9d0614edbb
commit 59d2f6db75
2 changed files with 2 additions and 2 deletions

View File

@ -43,7 +43,7 @@ start_sidekiq()
load_ok() load_ok()
{ {
sidekiq_pid=$(cat $sidekiq_pidfile) sidekiq_pid=$(cat $sidekiq_pidfile)
if [ -z $sidekiq_pid ] ; then if [ -z "$sidekiq_pid" ] ; then
warn "Could not find a PID in $sidekiq_pidfile" warn "Could not find a PID in $sidekiq_pidfile"
exit 0 exit 0
fi fi

View File

@ -9,7 +9,7 @@ unicorn_config="$app_root/config/unicorn.rb"
get_unicorn_pid() get_unicorn_pid()
{ {
local pid=$(cat $unicorn_pidfile) local pid=$(cat $unicorn_pidfile)
if [ -z $pid ] ; then if [ -z "$pid" ] ; then
echo "Could not find a PID in $unicorn_pidfile" echo "Could not find a PID in $unicorn_pidfile"
exit 1 exit 1
fi fi