Skip to content

Instantly share code, notes, and snippets.

@youzipi
Forked from lhcpig/start.sh
Created April 14, 2017 09:12
Show Gist options
  • Save youzipi/44e4e49e08caa6f35197d7fe2551649e to your computer and use it in GitHub Desktop.
Save youzipi/44e4e49e08caa6f35197d7fe2551649e to your computer and use it in GitHub Desktop.
jenkins 部署spring-boot应用
#!/bin/sh
nohup /usr/bin/java -jar $1 >> $2 &
#!/bin/sh
pid=`/usr/sbin/lsof -i:$1 | grep java | awk '{print $2}'`
if test -z "$pid"
then
echo 'api has not been started'
echo 'skip kill it'
else
echo "kill $pid"
kill -9 $pid
sleep 5
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment