2011-01-13 03:21:23 +01:00
|
|
|
#! /bin/sh
|
2021-02-26 10:05:35 +01:00
|
|
|
# $Id: killall,v 1.4 2019/12/10 23:48:58 tom Exp $
|
2011-01-13 03:21:23 +01:00
|
|
|
# Linux has a program that does this correctly.
|
2012-10-21 20:18:09 +02:00
|
|
|
|
|
|
|
. ./setup-vars
|
|
|
|
|
2021-02-26 10:05:35 +01:00
|
|
|
for prog in "$@"
|
2011-01-13 03:21:23 +01:00
|
|
|
do
|
2021-02-26 10:05:35 +01:00
|
|
|
pid=`ps -a |fgrep "$prog" |fgrep -v fgrep|sed -e 's/^[ ]*//' -e 's/ .*//' `
|
2011-01-13 03:21:23 +01:00
|
|
|
if test -n "$pid" ; then
|
2021-02-26 10:05:35 +01:00
|
|
|
echo "killing pid=$pid, $prog"
|
|
|
|
kill "-$SIG_HUP" "$pid" || \
|
|
|
|
kill "-$SIG_TERM" "$pid" || \
|
|
|
|
kill "-$SIG_KILL" "$pid"
|
2011-01-13 03:21:23 +01:00
|
|
|
fi
|
|
|
|
done
|