Skip to content

Instantly share code, notes, and snippets.

@romanr
Forked from justinholmes/deploy.sh
Created August 1, 2013 07:48
Show Gist options
  • Save romanr/6129277 to your computer and use it in GitHub Desktop.
Save romanr/6129277 to your computer and use it in GitHub Desktop.
#!/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