summaryrefslogtreecommitdiff
path: root/package/procps/killall
blob: 0f4ed7ceb969fe168b1bbd03ae237fb055be0f5e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/bin/ash
dolist=0
doquiet=0
l=1
x=$#
signal=
while [ $x -gt 0 ]; do
	case $1 in
	-l)	dolist=1 ;;
	-q)	doquiet=1 ;;
	-lq|-ql)
		dolist=1
		doquiet=1
		;;
	-*)	signal=$1 ;;
	*)	break ;;
	esac
	shift
	x=$(expr $x - 1)
done
[ $dolist = 1 ] && kill -l
pkill -x $signal "$@"
rv=$?
[ $doquiet = 1 ] && exit 0
exit $rv