Created
October 2, 2013 11:35
-
-
Save bak1an/6792401 to your computer and use it in GitHub Desktop.
silly jenkins start-stop scripts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
cd %JENKINS_DIR% | |
nohup java -jar jenkins.war --httpListenAddress=127.0.0.1 --httpPort=12121 > jenkins.log 2>&1 & echo $! > jenkins.pid |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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