summaryrefslogtreecommitdiff
path: root/noncore/tools/opie-sh/scripts/service_manager.sh
Unidiff
Diffstat (limited to 'noncore/tools/opie-sh/scripts/service_manager.sh') (more/less context) (ignore whitespace changes)
-rwxr-xr-xnoncore/tools/opie-sh/scripts/service_manager.sh6
1 files changed, 3 insertions, 3 deletions
diff --git a/noncore/tools/opie-sh/scripts/service_manager.sh b/noncore/tools/opie-sh/scripts/service_manager.sh
index d1423a5..e3c04bc 100755
--- a/noncore/tools/opie-sh/scripts/service_manager.sh
+++ b/noncore/tools/opie-sh/scripts/service_manager.sh
@@ -1,89 +1,89 @@
1#!/bin/sh 1#!/bin/sh
2 2
3# service_manager.sh - a demonstration of opie-sh 3# service_manager.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 - added icon to statusinfo... 17# 20020524-1 - added icon to statusinfo...
18# 20020518-1 - optix 18# 20020518-1 - optix
19# 20020517-1 - added about and fullscreen 19# 20020517-1 - added about and fullscreen
20# 20#
21 21
22OPIE_SH=/opt/QtPalmtop/bin/opie-sh 22OPIE_SH=$OPIEDIR/bin/opie-sh
23INITPATH=/etc/init.d 23INITPATH=/etc/init.d
24 24
25###################################################################### 25######################################################################
26# subroutines 26# subroutines
27 27
28about() { 28about() {
29 ( echo "<img src=/opt/QtPalmtop/pics/opie-sh-scripts/service_manager.png>" 29 ( echo "<img src=$OPIEDIR/pics/opie-sh-scripts/service_manager.png>"
30 echo "<h3>About</h3>" 30 echo "<h3>About</h3>"
31 echo "This little App should make it possible for you to " 31 echo "This little App should make it possible for you to "
32 echo "easily start and stop services in /etc/init.d." 32 echo "easily start and stop services in /etc/init.d."
33 echo "<p>" 33 echo "<p>"
34 ) | $OPIE_SH -t service-manager -f & 34 ) | $OPIE_SH -t service-manager -f &
35 SCREENCLEAN=$! 35 SCREENCLEAN=$!
36 sleep 1 36 sleep 1
37} 37}
38 38
39cleanup() { 39cleanup() {
40 kill $SCREENCLEAN 40 kill $SCREENCLEAN
41 rm -f /tmp/qcop-msg-service_manager.sh 41 rm -f /tmp/qcop-msg-service_manager.sh
42} 42}
43 43
44get_action() { 44get_action() {
45 # ask what to do (start/stop/status) 45 # ask what to do (start/stop/status)
46 # 46 #
47 $OPIE_SH -m -t "Select Action" \ 47 $OPIE_SH -m -t "Select Action" \
48 -M "which action do you want to do to $SERVICE ?<br>" \ 48 -M "which action do you want to do to $SERVICE ?<br>" \
49 -g -0 start -1 stop -2 status 49 -g -0 start -1 stop -2 status
50 RETURNCODE=$? 50 RETURNCODE=$?
51 51
52 case $RETURNCODE in 52 case $RETURNCODE in
53 -1) echo unexpected input detected, exiting. 53 -1) echo unexpected input detected, exiting.
54 exit ;; 54 exit ;;
55 0) ACTION=start ;; 55 0) ACTION=start ;;
56 1) ACTION=stop ;; 56 1) ACTION=stop ;;
57 2) ACTION=status ;; 57 2) ACTION=status ;;
58 esac 58 esac
59} 59}
60 60
61status_disclaimer() { 61status_disclaimer() {
62 # tell that init scripts are not too standard 62 # tell that init scripts are not too standard
63 # 63 #
64 cat | $OPIE_SH -f <<EOT 64 cat | $OPIE_SH -f <<EOT
65<img src=/opt/QtPalmtop/pics/opie-sh-scripts/service_manager.png> 65<img src=$OPIEDIR/pics/opie-sh-scripts/service_manager.png>
66<h3>status has been disabled</h3> 66<h3>status has been disabled</h3>
67 67
68 the status service has been disabled 68 the status service has been disabled
69 because it is not supported by the 69 because it is not supported by the
70 most init scripts that come with 70 most init scripts that come with
71 familiar ...<p> 71 familiar ...<p>
72 72
73 perhaps it will be replaced with 73 perhaps it will be replaced with
74 something more useful in the future... 74 something more useful in the future...
75EOT 75EOT
76} 76}
77 77
78select_service() { 78select_service() {
79 # present service list and choose 79 # present service list and choose
80 # 80 #
81 cd $INITPATH/ 81 cd $INITPATH/
82 SERVICE=` ls -1 | $OPIE_SH -i -l \ 82 SERVICE=` ls -1 | $OPIE_SH -i -l \
83 -g -t "Select Service" \ 83 -g -t "Select Service" \
84 ` 84 `
85 cd - 85 cd -
86} 86}
87 87
88###################################################################### 88######################################################################
89# main 89# main