Skip to content

Instantly share code, notes, and snippets.

@benburkert
Forked from ivey/restart.sh
Created October 29, 2008 04:53
Show Gist options
  • Save benburkert/20624 to your computer and use it in GitHub Desktop.
Save benburkert/20624 to your computer and use it in GitHub Desktop.
declare -a pids
i=0
for pid in log/merb.*.pid ; do
if [ $pid == "log/merb.main.pid" ]; then
echo "Killing master process"
kill -9 `cat $pid`
else
pids[$i]=`cat $pid`
fi
(( i++ ))
done
ps ax | grep 'merb : spawner' | awk '{print $1}' | xargs kill -9
# start your new merbs
# merb -whatever
for pid in ${pids[@]} ; do
echo "Killing $pid"
kill -9 $pid
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment