From 4570f4ee47986a4f066a6fcc24968cd20770ba32 Mon Sep 17 00:00:00 2001 From: Greg North Date: Wed, 3 Feb 2016 17:19:11 -0500 Subject: [PATCH] Assigning init.d script param to a variable On centos 7.2, line 22 ends up wiping out the passed in param which always results in this output: `Usage: /etc/init.d/codedeploy-agent {start|stop|status|restart}`. Assigning it to a variable prior and using it in the switch statement get this working properly. --- init.d/codedeploy-agent | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/init.d/codedeploy-agent b/init.d/codedeploy-agent index d4eadf42..e57a7073 100755 --- a/init.d/codedeploy-agent +++ b/init.d/codedeploy-agent @@ -17,7 +17,7 @@ # the deployment artifacts on to this instance. ### END INIT INFO - +COMMAND=$1 RETVAL=0 [ -f /etc/profile ] && [ "`stat --format '%U %G' /etc/profile`" == "root root" ] && source /etc/profile @@ -59,7 +59,7 @@ update() { $INSTALLER auto #Update the agent } -case "$1" in +case "$COMMAND" in start) start ;;