Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

handle multi-word arguments for heart restart command

  • Loading branch information...
commit 9194d12bc719d65fb4ef5c27de231f1f0612289c 1 parent a1f8536
@vinoski vinoski authored
Showing with 11 additions and 1 deletion.
  1. +11 −1 scripts/yaws.template
View
12 scripts/yaws.template
@@ -136,7 +136,17 @@ if [ "$HEART" = true ]; then
fi
fi
fi
-HEART_COMMAND="$ENV_PGM HEART=true YAWS_HEART_RESTARTS=$restarts YAWS_HEART_START=$starttime $program "${1+"$@"}
+HEART_COMMAND="$ENV_PGM HEART=true YAWS_HEART_RESTARTS=$restarts YAWS_HEART_START=$starttime $program"
+# This loop quotes arguments containing whitespace so they can be passed
+# properly to the next heart restart
+for arg in "$@"; do
+ ws=`( set X $arg ; echo $# )`
+ if [ "$ws" -gt 2 ]; then
+ HEART_COMMAND="$HEART_COMMAND '$arg'"
+ else
+ HEART_COMMAND="$HEART_COMMAND $arg"
+ fi
+done
export HEART_COMMAND
while [ $# -gt 0 ]
Please sign in to comment.
Something went wrong with that request. Please try again.