summaryrefslogtreecommitdiff
path: root/noncore/tools/opie-sh/scripts/opie-sh-wavelanchooser.sh
Unidiff
Diffstat (limited to 'noncore/tools/opie-sh/scripts/opie-sh-wavelanchooser.sh') (more/less context) (ignore whitespace changes)
-rwxr-xr-xnoncore/tools/opie-sh/scripts/opie-sh-wavelanchooser.sh62
1 files changed, 62 insertions, 0 deletions
diff --git a/noncore/tools/opie-sh/scripts/opie-sh-wavelanchooser.sh b/noncore/tools/opie-sh/scripts/opie-sh-wavelanchooser.sh
new file mode 100755
index 0000000..13a1e79
--- a/dev/null
+++ b/noncore/tools/opie-sh/scripts/opie-sh-wavelanchooser.sh
@@ -0,0 +1,62 @@
1#!/bin/sh
2
3# wavelanchooser.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# 20020528-1 - fixed filename in cleanup
18# 20020526-1 - rudimental but working
19# 20020524-1 - initial working release planned
20#
21
22OPIE_SH=opie-sh
23
24about() {
25 ( echo "<img src=/opt/QtPalmtop/pics/opie-sh-scripts/qtwavelan.png>"
26 echo "<h3>About</h3>"
27 echo "This little App is for changing the location setting"
28 echo "for your wireless card. <br>"
29 echo "actually it only starts /etc/init.d/[home|work] and can"
30 echo "be easily turned into a quick program to start the service"
31 echo "or init script you use most."
32 echo "<p>"
33 ) | $OPIE_SH -t wavelanchooser -f &
34 SCREENCLEAN=$!
35 sleep 1
36}
37
38cleanup() {
39 kill $SCREENCLEAN $SCREENCLEAN2
40 rm -f /tmp/qcop-msg-opie-sh-wavelanchooser.sh
41}
42
43
44about
45
46# choose if work or home
47 $OPIE_SH -m -t "network-settings dialog" \
48 -M "which configuration do you want ? " \
49 -w -0 home -1 work -g
50
51if [ "$?" = "0" ]
52 thenDECISION=home
53 elseDECISION=work
54fi
55
56( echo "you decided to choose $DECISION configuration. "
57 echo "remember to reinsert card."
58 /etc/init.d/$DECISION start
59) | $OPIE_SH -t "confirmation" -f \
60
61
62cleanup