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