1 2 3 4 5 6 7 8 9 10 11 12 13 14
#! /bin/sh #. ../env.sh for p in pid/*.pid*; do test -f "$p" || continue pid=`cat "$p"` test -d "/proc/$pid" || { rm -f "$p" continue } kill "$pid" done