Skip to content

Instantly share code, notes, and snippets.

@bak1an
Created October 2, 2013 11:35
Show Gist options
  • Save bak1an/6792401 to your computer and use it in GitHub Desktop.
Save bak1an/6792401 to your computer and use it in GitHub Desktop.
silly jenkins start-stop scripts
#!/bin/sh
cd %JENKINS_DIR%
nohup java -jar jenkins.war --httpListenAddress=127.0.0.1 --httpPort=12121 > jenkins.log 2>&1 & echo $! > jenkins.pid
#!/bin/sh
cd %JENKINS_DIR%
if [ -e jenkins.pid ]; then
PID="`cat jenkins.pid`"
kill $PID
while true; do
echo -n .
sleep 1
if [ ! -d /proc/$PID ]; then
echo
break
fi
done
rm jenkins.pid
echo "jenkins killed"
else
echo "nothing to kill"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment