@@ -22,18 +22,18 @@ RETVAL=0
22
22
[ -f /etc/profile ] && [ " ` stat --format ' %U %G' /etc/profile` " == " root root" ] && source /etc/profile
23
23
24
24
prog=" codedeploy-agent"
25
- # Modify the following USER variable to run the codedeploy process as a non-root user
25
+ # Modify the following CODEDEPLOY_USER variable to run the codedeploy process as a non-root user
26
26
# Note: You also need to chown /opt/codedeploy /var/log/aws
27
- USER =" "
27
+ CODEDEPLOY_USER =" "
28
28
AGENT_ROOT=" /opt/codedeploy-agent/"
29
29
INSTALLER=" /opt/codedeploy-agent/bin/install"
30
30
BIN=" /opt/codedeploy-agent/bin/codedeploy-agent-wrapper"
31
31
32
32
start () {
33
33
echo -n $" Starting $prog :"
34
34
cd $AGENT_ROOT
35
- if [ $USER ]; then
36
- nohup sudo -i -u $USER $BIN start > /dev/null < /dev/null 2>&1 # Try to start the server
35
+ if [ $CODEDEPLOY_USER ]; then
36
+ nohup sudo -i -u $CODEDEPLOY_USER $BIN start > /dev/null < /dev/null 2>&1 # Try to start the server
37
37
else
38
38
nohup $BIN start > /dev/null < /dev/null 2>&1 # Try to start the server
39
39
fi
@@ -43,8 +43,8 @@ start() {
43
43
stop () {
44
44
echo -n $" Stopping $prog :"
45
45
cd $AGENT_ROOT
46
- if [ $USER ]; then
47
- nohup sudo -i -u $USER $BIN stop > /dev/null < /dev/null 2>&1 # Try to stop the server
46
+ if [ $CODEDEPLOY_USER ]; then
47
+ nohup sudo -i -u $CODEDEPLOY_USER $BIN stop > /dev/null < /dev/null 2>&1 # Try to stop the server
48
48
else
49
49
nohup $BIN stop > /dev/null < /dev/null 2>&1 # Try to stop the server
50
50
fi
@@ -54,8 +54,8 @@ stop() {
54
54
restart () {
55
55
echo -n $" Restarting $prog :"
56
56
cd $AGENT_ROOT
57
- if [ $USER ]; then
58
- nohup sudo -i -u $USER $BIN restart > /dev/null < /dev/null 2>&1 # Try to restart the server
57
+ if [ $CODEDEPLOY_USER ]; then
58
+ nohup sudo -i -u $CODEDEPLOY_USER $BIN restart > /dev/null < /dev/null 2>&1 # Try to restart the server
59
59
else
60
60
nohup $BIN restart > /dev/null < /dev/null 2>&1 # Try to restart the server
61
61
fi
@@ -64,8 +64,8 @@ restart() {
64
64
65
65
status () {
66
66
cd $AGENT_ROOT
67
- if [ $USER ]; then
68
- sudo -i -u $USER $BIN status # Status of the server
67
+ if [ $CODEDEPLOY_USER ]; then
68
+ sudo -i -u $CODEDEPLOY_USER $BIN status # Status of the server
69
69
else
70
70
$BIN status # Status of the server
71
71
fi
0 commit comments