From bd9e6617827818fd043452c08c606f07b78014a0 Mon Sep 17 00:00:00 2001 From: toma Date: Wed, 25 Nov 2009 17:56:58 +0000 Subject: Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features. BUG:215923 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdesdk@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- scripts/kdekillall | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100755 scripts/kdekillall (limited to 'scripts/kdekillall') diff --git a/scripts/kdekillall b/scripts/kdekillall new file mode 100755 index 00000000..deb5aef5 --- /dev/null +++ b/scripts/kdekillall @@ -0,0 +1,28 @@ +#! /bin/sh + +case $1 in + -*) signal=$1; shift;; +esac +if [ $# = 0 ]; then + echo "Usage: $0 [-] " + echo 'Kills the process "kdeinit: with signal "' + echo "if is not specified, it defaults to SIGTERM," + echo "see kill -l for a list of possible signals" +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... + list=$(ps auwx | grep $USER | awk "/\[kdeinit\] $1/ {print \$2}") + fi + if test -z "$list"; then + # with KDE 3.4 we changed the view again... + list=$(ps auwx | grep $USER | awk "/$1 \[kdeinit\]/ {print \$2}") + fi + if test -n "$list"; then + kill $signal $list + else + echo 'No process killed' + exit 1 + fi +fi -- cgit v1.2.1