Skip to content

Instantly share code, notes, and snippets.

@gravcat
Forked from yatesr/bamboo-agent
Created September 19, 2016 15:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gravcat/cc90cdd01f059296c78e87130614d7d0 to your computer and use it in GitHub Desktop.
Save gravcat/cc90cdd01f059296c78e87130614d7d0 to your computer and use it in GitHub Desktop.
Init script for starting/stopping a bamboo agent
#!/bin/bash
# bamboo-agent Init script for running bamboo agent
#
# chkconfig: 2345 98 02
#
# description: Starts and stops bamboo agent
# This is just a delegator to the Bamboo agent script.
USER=bamboo
AGENT_HOME=/home/$USER/bamboo-agent-home/bin
if [[ "$EUID" != '0' ]]; then
echo 'This script must be run as root!'
exit 1
fi
status=`su - $USER -c "$AGENT_HOME/bamboo-agent.sh $@ 1>&2 ;"' echo $?'`
exit $status
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment