From 928f4d02c259957072188e030c23a3cea4a20719 Mon Sep 17 00:00:00 2001 From: lelonek1 Date: Wed, 21 Dec 2016 03:22:32 -0500 Subject: [PATCH] Use $@ instead of $* so quoted parameters are expanded correctly and support specifying alternate venv name in COWRIE_VENV environment variable (#384) --- bin/cowrie | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/bin/cowrie b/bin/cowrie index 9d15a1d..2262385 100755 --- a/bin/cowrie +++ b/bin/cowrie @@ -40,14 +40,13 @@ cowrie_status() { cowrie_start() { # Start Cowrie - XARGS=$* - activate_venv "cowrie-env" - echo "Starting cowrie with extra arguments [$XARGS] ..." + activate_venv "${COWRIE_VENV:-cowrie-env}" + echo "Starting cowrie with extra arguments [$@] ..." if [ $AUTHBIND_ENABLED = "no" ] then - twistd $XARGS -l ${LOGFILE} --umask ${UMASK} --pidfile ${PIDFILE} cowrie + twistd "$@" -l ${LOGFILE} --umask ${UMASK} --pidfile ${PIDFILE} cowrie else - authbind --deep twistd $XARGS -l ${LOGFILE} --umask ${UMASK} --pidfile ${PIDFILE} cowrie + authbind --deep twistd "$@" -l ${LOGFILE} --umask ${UMASK} --pidfile ${PIDFILE} cowrie fi } @@ -86,17 +85,17 @@ key=$1 shift 1 case $key in stop) - cowrie_stop $* + cowrie_stop "$@" ;; start) - cowrie_start $* + cowrie_start "$@" ;; status) - cowrie_status $* + cowrie_status "$@" ;; restart) cowrie_stop - cowrie_start $* + cowrie_start "$@" ;; *) cowrie_usage