Skip to content

Instantly share code, notes, and snippets.

@ivey
Created October 29, 2008 02:17
Show Gist options
  • Save ivey/20588 to your computer and use it in GitHub Desktop.
Save ivey/20588 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
# 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