You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
29 lines
896 B
29 lines
896 B
15 years ago
|
#! /bin/sh
|
||
|
|
||
|
case $1 in
|
||
|
-*) signal=$1; shift;;
|
||
|
esac
|
||
|
if [ $# = 0 ]; then
|
||
|
echo "Usage: $0 [-<signal>] <process>"
|
||
13 years ago
|
echo 'Kills the process "tdeinit: <process> with signal <signal>"'
|
||
15 years ago
|
echo "if <signal> is not specified, it defaults to SIGTERM,"
|
||
11 years ago
|
echo "see kill -l for a list of possible SIGNALS"
|
||
15 years ago
|
else
|
||
|
list=$(ps auwx | grep $USER | awk "/[k]deinit: $1/ {print \$2}")
|
||
|
if test -z "$list"; then
|
||
|
# on newer Linux kernels (>= 2.6.10) KDE is able to use
|
||
|
# prctl(PR_SET_NAME) to change the process name...
|
||
13 years ago
|
list=$(ps auwx | grep $USER | awk "/\[tdeinit\] $1/ {print \$2}")
|
||
15 years ago
|
fi
|
||
|
if test -z "$list"; then
|
||
|
# with KDE 3.4 we changed the view again...
|
||
13 years ago
|
list=$(ps auwx | grep $USER | awk "/$1 \[tdeinit\]/ {print \$2}")
|
||
15 years ago
|
fi
|
||
|
if test -n "$list"; then
|
||
|
kill $signal $list
|
||
|
else
|
||
|
echo 'No process killed'
|
||
|
exit 1
|
||
|
fi
|
||
|
fi
|