summaryrefslogtreecommitdiff
path: root/noncore/tools/opie-sh/scripts/killproc.sh
Unidiff
Diffstat (limited to 'noncore/tools/opie-sh/scripts/killproc.sh') (more/less context) (ignore whitespace changes)
-rwxr-xr-xnoncore/tools/opie-sh/scripts/killproc.sh71
1 files changed, 71 insertions, 0 deletions
diff --git a/noncore/tools/opie-sh/scripts/killproc.sh b/noncore/tools/opie-sh/scripts/killproc.sh
new file mode 100755
index 0000000..8afb4b8
--- a/dev/null
+++ b/noncore/tools/opie-sh/scripts/killproc.sh
@@ -0,0 +1,71 @@
1#!/bin/sh
2
3# killproc.sh - a demonstration of opie-sh
4#
5# Copyright (C) 2002 gonz@directbox.com
6#
7# This program is free software; you can redistribute it and/or modify
8# it under the terms of the GNU General Public License as published by
9# the Free Software Foundation; either version 2, or (at your option)
10# any later version.
11#
12# This program is distributed in the hope that it will be useful,
13# but WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15# GNU General Public License for more details.
16#
17# 20020524-1 - code optix
18# 20020519-1 - added icon to output
19# 20020517-1 - nicer fullscreen, added about, tried icon
20
21OPIE_SH=/opt/QtPalmtop/bin/opie-sh
22
23######################################################################
24# subroutines
25
26about() {
27 ( echo "<img src=/opt/QtPalmtop/pics/opie-sh-scripts/killproc.png>"
28 echo "<h3>About</h3>"
29 echo "This little util sends the TERM signal "
30 echo "to the specified process or process group. "
31 echo "The TERM signal will kill processes which "
32 echo "do not catch this signal. "
33 echo "<p> "
34 ) | $OPIE_SH -t opie-killproc -f &
35 SCREENCLEAN=$!
36 sleep 1
37}
38
39cleanup() {
40 kill $SCREENCLEAN
41 rm -f /tmp/qcop-msg-killproc.sh
42}
43
44select_process() {
45 # present process list and choose
46 #
47 PROCESS=`ps -eaf | cut -b 10-15,40- \
48 | cut -b -40 \
49 | grep -v "TIME CMD" \
50 | $OPIE_SH -i -l -g \
51 -t "Select Process" `
52}
53
54######################################################################
55# main
56
57about
58select_process
59
60PROCESS=`echo $PROCESS | cut -b -4`
61
62
63( echo "<img src=/opt/QtPalmtop/pics/opie-sh-scripts/killproc.png>"
64 echo "<h3>Output of kill $PROCESS</h3>"
65 echo "<pre>"
66 kill $PROCESS 2>&1
67 echo "</pre><p>"
68 echo done.
69) | $OPIE_SH -f
70
71cleanup