Skip to content

Instantly share code, notes, and snippets.

@yatesr
Created January 15, 2014 20:24
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save yatesr/8443849 to your computer and use it in GitHub Desktop.
Save yatesr/8443849 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