Skip to content

Instantly share code, notes, and snippets.

@justinholmes
Created June 5, 2012 21:01
Show Gist options
  • Save justinholmes/2877877 to your computer and use it in GitHub Desktop.
Save justinholmes/2877877 to your computer and use it in GitHub Desktop.
Deployment script on remote server
#!/bin/bash
unzip -o filename-1.0
chmod a+x filename-1.0/start
gline=$(ps -ewwo pid,args | grep "play.core.server.NettyServer")
echo $gline
IN=$gline
set -- "$IN"
IFS=" "; declare -a Array=($*)
PlayProcess="$(ps -ewwo pid,args | grep "play.core.server.NettyServer")"
echo $PlayProcess
condition=""
if [[ $PlayProcess != $condition ]]
then
echo "Killing process: ${Array[0]}"
kill ${Array[0]}
fi
nohup ./filename-1.0/start & ## OR other deployment methods
exit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment