Skip to content

Instantly share code, notes, and snippets.

@sparsick
Last active February 28, 2017 08:38
Show Gist options
  • Save sparsick/b9a6052dd9c202a09f6480e75e41ee8a to your computer and use it in GitHub Desktop.
Save sparsick/b9a6052dd9c202a09f6480e75e41ee8a to your computer and use it in GitHub Desktop.
Jenkins Startscript
#!/bin/bash
export JENKINS_HOME=/path/to/your/jenkins/installation
export HTTP_PORT=8001
export AJP_PORT=8002
export CONTROL_PORT=8003
case "$1" in
start)
nohup java -Djava.awt.headless=true -jar $JENKINS_HOME/jenkins.war --httpPort=$HTTP_PORT --controlPort=$CONTROL_PORT > $JENKINS_HOME/jenkins.log 2>&1 &
;;
stop)
java -cp $JENKINS_HOME/war/winstone.jar winstone.tools.WinstoneControl shutdown --host=localhost --port=$CONTROL_PORT
;;
restart)
java -cp $JENKINS_HOME/war/winstone.jar winstone.tools.WinstoneControl reload --host=localhost --port=$CONTROL_PORT
;;
*)
echo "usage: jenkins.sh
$0 start | stop | restart"
exit 1
;;
esac
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment