author | zecke <zecke> | 2004-08-14 12:05:39 (UTC) |
---|---|---|
committer | zecke <zecke> | 2004-08-14 12:05:39 (UTC) |
commit | 3df06db9e6fd268c7d234be05b01a2303dc0f7ba (patch) (unidiff) | |
tree | 6a642674a0a69729c207337e63e20b8e02f40ec4 /noncore/tools/opie-sh/scripts | |
parent | 7cee03c63afadac76e87e276a5ef7b1bba27847b (diff) | |
download | opie-3df06db9e6fd268c7d234be05b01a2303dc0f7ba.zip opie-3df06db9e6fd268c7d234be05b01a2303dc0f7ba.tar.gz opie-3df06db9e6fd268c7d234be05b01a2303dc0f7ba.tar.bz2 |
Do not hardcode /opt/QtPalmtop but use $OPIEDIR
Diffstat (limited to 'noncore/tools/opie-sh/scripts') (more/less context) (ignore whitespace changes)
-rwxr-xr-x | noncore/tools/opie-sh/scripts/diskfree.sh | 4 | ||||
-rwxr-xr-x | noncore/tools/opie-sh/scripts/filesystem_mounter.sh | 8 | ||||
-rwxr-xr-x | noncore/tools/opie-sh/scripts/hostlist.sh | 6 | ||||
-rwxr-xr-x | noncore/tools/opie-sh/scripts/killproc.sh | 6 | ||||
-rwxr-xr-x | noncore/tools/opie-sh/scripts/launcher_refresh.sh | 10 | ||||
-rwxr-xr-x | noncore/tools/opie-sh/scripts/logviewer.sh | 8 | ||||
-rwxr-xr-x | noncore/tools/opie-sh/scripts/opie-sh-ssh-askpass.sh | 2 | ||||
-rwxr-xr-x | noncore/tools/opie-sh/scripts/opie-sh-wavelanchooser.sh | 4 | ||||
-rwxr-xr-x | noncore/tools/opie-sh/scripts/rsyncme.sh | 6 | ||||
-rwxr-xr-x | noncore/tools/opie-sh/scripts/service_manager.sh | 6 | ||||
-rwxr-xr-x | noncore/tools/opie-sh/scripts/stowctrl.sh | 8 | ||||
-rwxr-xr-x | noncore/tools/opie-sh/scripts/usbnetctrl.sh | 12 |
12 files changed, 40 insertions, 40 deletions
diff --git a/noncore/tools/opie-sh/scripts/diskfree.sh b/noncore/tools/opie-sh/scripts/diskfree.sh index 78415e3..0f17f15 100755 --- a/noncore/tools/opie-sh/scripts/diskfree.sh +++ b/noncore/tools/opie-sh/scripts/diskfree.sh | |||
@@ -1,44 +1,44 @@ | |||
1 | #!/bin/sh | 1 | #!/bin/sh |
2 | 2 | ||
3 | # diskfree.sh - a demonstration of opie-sh | 3 | # diskfree.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-5 - bugfix | 17 | # 20020524-5 - bugfix |
18 | # 20020524-1 - initial release | 18 | # 20020524-1 - initial release |
19 | 19 | ||
20 | OPIE_SH=/opt/QtPalmtop/bin/opie-sh | 20 | OPIE_SH=$OPIEDIR/bin/opie-sh |
21 | 21 | ||
22 | # there must be a better way to do this with sed, but i had no time | 22 | # there must be a better way to do this with sed, but i had no time |
23 | # time to look into this yet... | 23 | # time to look into this yet... |
24 | 24 | ||
25 | ( echo "<img src=/opt/QtPalmtop/pics/opie-sh-scripts/fsmounter.png>" | 25 | ( echo "<img src=$OPIEDIR/pics/opie-sh-scripts/fsmounter.png>" |
26 | echo "<h3>diskfree</h3> how much space is left ?<br>" | 26 | echo "<h3>diskfree</h3> how much space is left ?<br>" |
27 | echo "<p><table>" | 27 | echo "<p><table>" |
28 | 28 | ||
29 | df -h \ | 29 | df -h \ |
30 | | grep -v "Mounted on" \ | 30 | | grep -v "Mounted on" \ |
31 | | sed 's/ / /g' \ | 31 | | sed 's/ / /g' \ |
32 | | sed 's/ / /g' \ | 32 | | sed 's/ / /g' \ |
33 | | sed 's/ / /g' \ | 33 | | sed 's/ / /g' \ |
34 | | sed 's/ / /g' \ | 34 | | sed 's/ / /g' \ |
35 | | sed 's/ / /g' \ | 35 | | sed 's/ / /g' \ |
36 | | sed 's/ / /g' \ | 36 | | sed 's/ / /g' \ |
37 | | sed "s/ / /g" \ | 37 | | sed "s/ / /g" \ |
38 | | cut -d " " -f4- \ | 38 | | cut -d " " -f4- \ |
39 | | sed 's/ /<\/td><td>/g' \ | 39 | | sed 's/ /<\/td><td>/g' \ |
40 | | sed 's/$/<\/td><\/tr>/' \ | 40 | | sed 's/$/<\/td><\/tr>/' \ |
41 | | sed 's/^/<tr><td>/' ; echo "</table>" \ | 41 | | sed 's/^/<tr><td>/' ; echo "</table>" \ |
42 | ) | $OPIE_SH -t "Space left" -f | 42 | ) | $OPIE_SH -t "Space left" -f |
43 | 43 | ||
44 | rm -f /tmp/qcop-msg-diskfree.sh | 44 | rm -f /tmp/qcop-msg-diskfree.sh |
diff --git a/noncore/tools/opie-sh/scripts/filesystem_mounter.sh b/noncore/tools/opie-sh/scripts/filesystem_mounter.sh index faaf37c..ba461a1 100755 --- a/noncore/tools/opie-sh/scripts/filesystem_mounter.sh +++ b/noncore/tools/opie-sh/scripts/filesystem_mounter.sh | |||
@@ -1,126 +1,126 @@ | |||
1 | #!/bin/sh | 1 | #!/bin/sh |
2 | 2 | ||
3 | # filesystem_mounter.sh - a demonstration of opie-sh | 3 | # filesystem_mounter.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-2 - using df from diskfree now | 17 | # 20020524-2 - using df from diskfree now |
18 | # 20020524-1 - just code optix | 18 | # 20020524-1 - just code optix |
19 | # 20020519-1 - added information screen with manpage excerpt, added | 19 | # 20020519-1 - added information screen with manpage excerpt, added |
20 | # better returncode-checking | 20 | # better returncode-checking |
21 | # 20020517-2 - fixed output bug | 21 | # 20020517-2 - fixed output bug |
22 | # 20020517-1 - nicer fullscreen, added about, tried icon | 22 | # 20020517-1 - nicer fullscreen, added about, tried icon |
23 | # | 23 | # |
24 | 24 | ||
25 | OPIE_SH=/opt/QtPalmtop/bin/opie-sh | 25 | OPIE_SH=$OPIEDIR/bin/opie-sh |
26 | 26 | ||
27 | ###################################################################### | 27 | ###################################################################### |
28 | # subroutines | 28 | # subroutines |
29 | 29 | ||
30 | about() { | 30 | about() { |
31 | ( echo "<img src=/opt/QtPalmtop/pics/opie-sh-scripts/fsmounter.png>" | 31 | ( echo "<img src=$OPIEDIR/pics/opie-sh-scripts/fsmounter.png>" |
32 | echo "<h3>About</h3>" | 32 | echo "<h3>About</h3>" |
33 | echo "This little App should make it possible for you to " | 33 | echo "This little App should make it possible for you to " |
34 | echo "easily mount and unmount filesystems from /etc/fstab" | 34 | echo "easily mount and unmount filesystems from /etc/fstab" |
35 | echo "<p>" | 35 | echo "<p>" |
36 | ) | $OPIE_SH -t fsmounter -f & | 36 | ) | $OPIE_SH -t fsmounter -f & |
37 | SCREENCLEAN=$! | 37 | SCREENCLEAN=$! |
38 | sleep 1 | 38 | sleep 1 |
39 | } | 39 | } |
40 | 40 | ||
41 | beforemount() { | 41 | beforemount() { |
42 | ( echo "<img src=/opt/QtPalmtop/pics/opie-sh-scripts/fsmounter.png>" | 42 | ( echo "<img src=$OPIEDIR/pics/opie-sh-scripts/fsmounter.png>" |
43 | echo "<h3>mount or unmount $MOUNTPOINT ?</h3>" | 43 | echo "<h3>mount or unmount $MOUNTPOINT ?</h3>" |
44 | echo "<b>excerpt from MOUNT(8) manpage:</b><p>" | 44 | echo "<b>excerpt from MOUNT(8) manpage:</b><p>" |
45 | echo "All files accessible in a Unix system are arranged in one | 45 | echo "All files accessible in a Unix system are arranged in one |
46 | big tree, the file hierarchy, rooted at <b>/</b>. These files | 46 | big tree, the file hierarchy, rooted at <b>/</b>. These files |
47 | can be spread out over several devices. The <b>mount</b> command | 47 | can be spread out over several devices. The <b>mount</b> command |
48 | serves to attach the file system found on some device to | 48 | serves to attach the file system found on some device to |
49 | the big file tree. Conversely, the <b>umount(8)</b> command will | 49 | the big file tree. Conversely, the <b>umount(8)</b> command will |
50 | detach it again." | 50 | detach it again." |
51 | echo "<p>" | 51 | echo "<p>" |
52 | ) | $OPIE_SH -t fsmounter -f & | 52 | ) | $OPIE_SH -t fsmounter -f & |
53 | SCREENCLEAN2=$! | 53 | SCREENCLEAN2=$! |
54 | sleep 1 | 54 | sleep 1 |
55 | } | 55 | } |
56 | 56 | ||
57 | 57 | ||
58 | cleanup() { | 58 | cleanup() { |
59 | kill $SCREENCLEAN $SCREENCLEAN2 | 59 | kill $SCREENCLEAN $SCREENCLEAN2 |
60 | rm -f /tmp/qcop-msg-filesystem_mounter.sh | 60 | rm -f /tmp/qcop-msg-filesystem_mounter.sh |
61 | } | 61 | } |
62 | 62 | ||
63 | get_action() { | 63 | get_action() { |
64 | # ask what to do (start/stop/status) | 64 | # ask what to do (start/stop/status) |
65 | # | 65 | # |
66 | $OPIE_SH -m -t "Select Action" \ | 66 | $OPIE_SH -m -t "Select Action" \ |
67 | -M "action for $MOUNTPOINT ?" \ | 67 | -M "action for $MOUNTPOINT ?" \ |
68 | -g -0 mount -1 umount | 68 | -g -0 mount -1 umount |
69 | RETURNCODE=$? | 69 | RETURNCODE=$? |
70 | 70 | ||
71 | case $RETURNCODE in | 71 | case $RETURNCODE in |
72 | -1|255) echo unexpected input detected, exiting. | $OPIE_SH -f | 72 | -1|255) echo unexpected input detected, exiting. | $OPIE_SH -f |
73 | cleanup ;; | 73 | cleanup ;; |
74 | 0) ACTION=mount ;; | 74 | 0) ACTION=mount ;; |
75 | 1) ACTION=umount ;; | 75 | 1) ACTION=umount ;; |
76 | esac | 76 | esac |
77 | kill $SCREENCLEAN2 | 77 | kill $SCREENCLEAN2 |
78 | } | 78 | } |
79 | 79 | ||
80 | select_mountpoint() { | 80 | select_mountpoint() { |
81 | # present service list and choose | 81 | # present service list and choose |
82 | # | 82 | # |
83 | MOUNTPOINT=` cat /etc/fstab | cut -f1 \ | 83 | MOUNTPOINT=` cat /etc/fstab | cut -f1 \ |
84 | | cut -d " " -f1 \ | 84 | | cut -d " " -f1 \ |
85 | | egrep -v "(tmpfs|proc|devpts|^#)" \ | 85 | | egrep -v "(tmpfs|proc|devpts|^#)" \ |
86 | | $OPIE_SH -i -l \ | 86 | | $OPIE_SH -i -l \ |
87 | -g -t "SELECT MOUNTPOINT" \ | 87 | -g -t "SELECT MOUNTPOINT" \ |
88 | -L "select fs: " ` | 88 | -L "select fs: " ` |
89 | } | 89 | } |
90 | 90 | ||
91 | ###################################################################### | 91 | ###################################################################### |
92 | # main | 92 | # main |
93 | 93 | ||
94 | about | 94 | about |
95 | select_mountpoint | 95 | select_mountpoint |
96 | beforemount | 96 | beforemount |
97 | get_action | 97 | get_action |
98 | 98 | ||
99 | if [ "$MOUNTPOINT" = "" ] | 99 | if [ "$MOUNTPOINT" = "" ] |
100 | then echo "ugly error...." | $OPIE_SH -f ; cleanup | 100 | then echo "ugly error...." | $OPIE_SH -f ; cleanup |
101 | fi | 101 | fi |
102 | 102 | ||
103 | ( echo "<img src=/opt/QtPalmtop/pics/opie-sh-scripts/fsmounter.png>" | 103 | ( echo "<img src=$OPIEDIR/pics/opie-sh-scripts/fsmounter.png>" |
104 | echo "<h3>Output of $ACTION $MOUNTPOINT :</h3>" | 104 | echo "<h3>Output of $ACTION $MOUNTPOINT :</h3>" |
105 | echo "<pre>" | 105 | echo "<pre>" |
106 | $ACTION $MOUNTPOINT 2>&1 | 106 | $ACTION $MOUNTPOINT 2>&1 |
107 | echo "</pre><p>" | 107 | echo "</pre><p>" |
108 | echo "<h3>diskfree</h3> how much space is left ?<br>" | 108 | echo "<h3>diskfree</h3> how much space is left ?<br>" |
109 | echo "<p><table>" | 109 | echo "<p><table>" |
110 | 110 | ||
111 | df -Ph \ | 111 | df -Ph \ |
112 | | grep -v "Mounted on" \ | 112 | | grep -v "Mounted on" \ |
113 | | sed 's/ / /g' \ | 113 | | sed 's/ / /g' \ |
114 | | sed 's/ / /g' \ | 114 | | sed 's/ / /g' \ |
115 | | sed 's/ / /g' \ | 115 | | sed 's/ / /g' \ |
116 | | sed 's/ / /g' \ | 116 | | sed 's/ / /g' \ |
117 | | sed 's/ / /g' \ | 117 | | sed 's/ / /g' \ |
118 | | sed 's/ / /g' \ | 118 | | sed 's/ / /g' \ |
119 | | sed "s/ / /g" \ | 119 | | sed "s/ / /g" \ |
120 | | cut -d " " -f4- \ | 120 | | cut -d " " -f4- \ |
121 | | sed 's/ /<\/td><td>/g' \ | 121 | | sed 's/ /<\/td><td>/g' \ |
122 | | sed 's/$/<\/td><\/tr>/' \ | 122 | | sed 's/$/<\/td><\/tr>/' \ |
123 | | sed 's/^/<tr><td>/' ; echo "</table>" \ | 123 | | sed 's/^/<tr><td>/' ; echo "</table>" \ |
124 | ) | $OPIE_SH -f | 124 | ) | $OPIE_SH -f |
125 | 125 | ||
126 | cleanup | 126 | cleanup |
diff --git a/noncore/tools/opie-sh/scripts/hostlist.sh b/noncore/tools/opie-sh/scripts/hostlist.sh index 6d70793..d7c94f8 100755 --- a/noncore/tools/opie-sh/scripts/hostlist.sh +++ b/noncore/tools/opie-sh/scripts/hostlist.sh | |||
@@ -1,80 +1,80 @@ | |||
1 | #!/bin/sh | 1 | #!/bin/sh |
2 | 2 | ||
3 | # hostlist.sh - a demonstration of opie-sh | 3 | # hostlist.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 - icon to hostlist | 17 | # 20020524-1 - icon to hostlist |
18 | # 20020517-1 - added icon, changed name in launcher | 18 | # 20020517-1 - added icon, changed name in launcher |
19 | # | 19 | # |
20 | 20 | ||
21 | CFG=/opt/QtPalmtop/share/config/hostlist.cfg | 21 | CFG=$OPIEDIR/share/config/hostlist.cfg |
22 | OPIE_SH=opie-sh | 22 | OPIE_SH=opie-sh |
23 | 23 | ||
24 | hostlist() { | 24 | hostlist() { |
25 | (echo "<img src=/opt/QtPalmtop/pics/opie-sh-scripts/hostlist.png>" | 25 | (echo "<img src=$OPIEDIR/pics/opie-sh-scripts/hostlist.png>" |
26 | echo "<h3>Hostlist</h3><br>" | 26 | echo "<h3>Hostlist</h3><br>" |
27 | HOSTLIST=`cat $CFG | grep -v '#'` | 27 | HOSTLIST=`cat $CFG | grep -v '#'` |
28 | for HOST in $HOSTLIST | 28 | for HOST in $HOSTLIST |
29 | do | 29 | do |
30 | PT=` ping -c 1 $HOST | grep avg|cut -d " " -f4-` | 30 | PT=` ping -c 1 $HOST | grep avg|cut -d " " -f4-` |
31 | if [ "$PT" != "" ] | 31 | if [ "$PT" != "" ] |
32 | then echo "<b><font color=#00ff00> " | 32 | then echo "<b><font color=#00ff00> " |
33 | echo "$HOST is up<br></font></b>[$PT]<br>" | 33 | echo "$HOST is up<br></font></b>[$PT]<br>" |
34 | else echo "<b><font color=#ff0000> " | 34 | else echo "<b><font color=#ff0000> " |
35 | echo "$HOST is down<br></font></b>[$PT]<br>" | 35 | echo "$HOST is down<br></font></b>[$PT]<br>" |
36 | fi | 36 | fi |
37 | done | 37 | done |
38 | ) | $OPIE_SH -t "Which are up ?" -f | 38 | ) | $OPIE_SH -t "Which are up ?" -f |
39 | 39 | ||
40 | 40 | ||
41 | } | 41 | } |
42 | 42 | ||
43 | cleanup() { | 43 | cleanup() { |
44 | kill $SCREENCLEAN | 44 | kill $SCREENCLEAN |
45 | rm -f /tmp/qcop-msg-hostlist.sh | 45 | rm -f /tmp/qcop-msg-hostlist.sh |
46 | } | 46 | } |
47 | 47 | ||
48 | about() { | 48 | about() { |
49 | ( echo "<img src=/opt/QtPalmtop/pics/opie-sh-scripts/hostlist.png>" | 49 | ( echo "<img src=$OPIEDIR/pics/opie-sh-scripts/hostlist.png>" |
50 | echo "<h3>About</h3>" | 50 | echo "<h3>About</h3>" |
51 | echo "This little App should make it possible for you to " | 51 | echo "This little App should make it possible for you to " |
52 | echo "check some hosts for availability." | 52 | echo "check some hosts for availability." |
53 | echo "<p>" | 53 | echo "<p>" |
54 | ) | $OPIE_SH -t hostlist -f & | 54 | ) | $OPIE_SH -t hostlist -f & |
55 | SCREENCLEAN=$! | 55 | SCREENCLEAN=$! |
56 | sleep 1 | 56 | sleep 1 |
57 | } | 57 | } |
58 | 58 | ||
59 | ##################################################################### | 59 | ##################################################################### |
60 | # | 60 | # |
61 | # main | 61 | # main |
62 | 62 | ||
63 | about | 63 | about |
64 | 64 | ||
65 | # ask to: start or edit list | 65 | # ask to: start or edit list |
66 | $OPIE_SH -m -g -t Hostlist -M "Welcome!" -0 Start -1 "Edit Hostlist" | 66 | $OPIE_SH -m -g -t Hostlist -M "Welcome!" -0 Start -1 "Edit Hostlist" |
67 | RETURNCODE=$? | 67 | RETURNCODE=$? |
68 | case $RETURNCODE in | 68 | case $RETURNCODE in |
69 | -1)echo died unexpectedly... | $OPIE_SH -f | 69 | -1)echo died unexpectedly... | $OPIE_SH -f |
70 | cleanup | 70 | cleanup |
71 | exit ;; | 71 | exit ;; |
72 | 1) textedit $CFG | 72 | 1) textedit $CFG |
73 | cleanup ;; | 73 | cleanup ;; |
74 | 0)if [ -f $CFG ] | 74 | 0)if [ -f $CFG ] |
75 | thenhostlist | 75 | thenhostlist |
76 | else echo www,handhelds.org >$CFG ; hostlist | 76 | else echo www,handhelds.org >$CFG ; hostlist |
77 | fi | 77 | fi |
78 | cleanup | 78 | cleanup |
79 | ;; | 79 | ;; |
80 | esac | 80 | esac |
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 |
diff --git a/noncore/tools/opie-sh/scripts/launcher_refresh.sh b/noncore/tools/opie-sh/scripts/launcher_refresh.sh index 7850508..c3b0617 100755 --- a/noncore/tools/opie-sh/scripts/launcher_refresh.sh +++ b/noncore/tools/opie-sh/scripts/launcher_refresh.sh | |||
@@ -1,44 +1,44 @@ | |||
1 | #!/bin/sh | 1 | #!/bin/sh |
2 | 2 | ||
3 | # launcher_refresh.sh - a demonstration of opie-sh | 3 | # launcher_refresh.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 | OPIE_SH=opie-sh | 17 | OPIE_SH=$OPIEDIR/bin/opie-sh |
18 | 18 | ||
19 | launcher_refresh() { | 19 | launcher_refresh() { |
20 | (echo "<img src=/opt/QtPalmtop/pics/opie-sh-scripts/launcher_refresh.png>" | 20 | (echo "<img src=$OPIEDIR/pics/opie-sh-scripts/launcher_refresh.png>" |
21 | echo "<h3>Refresh successful!</h3><br>" | 21 | echo "<h3>Refresh successful!</h3><br>" |
22 | echo the launcher has been refreshed. | 22 | echo the launcher has been refreshed. |
23 | echo | 23 | echo |
24 | echo this is useful if you installed packages using ipk instead of | 24 | echo this is useful if you installed packages using ipk instead of |
25 | echo oipkg. it is also helping if you are changing .desktop-files | 25 | echo oipkg. it is also helping if you are changing .desktop-files |
26 | echo often. | 26 | echo often. |
27 | echo "<p>" it also refreshes the input-methods. | 27 | echo "<p>" it also refreshes the input-methods. |
28 | ) | $OPIE_SH -t "launcher-refresh" -f | 28 | ) | $OPIE_SH -t "launcher-refresh" -f |
29 | } | 29 | } |
30 | 30 | ||
31 | cleanup() { | 31 | cleanup() { |
32 | rm -f /tmp/qcop-msg-launcher_refresh.sh | 32 | rm -f /tmp/qcop-msg-launcher_refresh.sh |
33 | } | 33 | } |
34 | 34 | ||
35 | ##################################################################### | 35 | ##################################################################### |
36 | # | 36 | # |
37 | # main | 37 | # main |
38 | 38 | ||
39 | /opt/QtPalmtop/bin/qcop QPE/TaskBar "reloadInputMethods()" | 39 | $OPIEDIR/bin/qcop QPE/TaskBar "reloadInputMethods()" |
40 | #/opt/QtPalmtop/bin/qcop QPE/System "restart()" | 40 | #$OPIEDIR/bin/qcop QPE/System "restart()" |
41 | /opt/QtPalmtop/bin/qcop QPE/System "linkChanged(QString)" | 41 | $OPIEDIR/bin/qcop QPE/System "linkChanged(QString)" |
42 | 42 | ||
43 | launcher_refresh | 43 | launcher_refresh |
44 | cleanup | 44 | cleanup |
diff --git a/noncore/tools/opie-sh/scripts/logviewer.sh b/noncore/tools/opie-sh/scripts/logviewer.sh index e9657b4..9b5dc25 100755 --- a/noncore/tools/opie-sh/scripts/logviewer.sh +++ b/noncore/tools/opie-sh/scripts/logviewer.sh | |||
@@ -1,116 +1,116 @@ | |||
1 | #!/bin/sh | 1 | #!/bin/sh |
2 | 2 | ||
3 | # logviewer.sh - a demonstration of opie-sh | 3 | # logviewer.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 | # 20020526-1a - initial release... | 17 | # 20020526-1a - initial release... |
18 | # | 18 | # |
19 | 19 | ||
20 | OPIE_SH=/opt/QtPalmtop/bin/opie-sh | 20 | OPIE_SH=$OPIEDIR/bin/opie-sh |
21 | INITPATH=/etc/init.d | 21 | INITPATH=/etc/init.d |
22 | 22 | ||
23 | ###################################################################### | 23 | ###################################################################### |
24 | # subroutines | 24 | # subroutines |
25 | 25 | ||
26 | about() { | 26 | about() { |
27 | ( echo "<img src=/opt/QtPalmtop/pics/opie-sh-scripts/logviewer.png>" | 27 | ( echo "<img src=$OPIEDIR/pics/opie-sh-scripts/logviewer.png>" |
28 | echo "<h3>About</h3>" | 28 | echo "<h3>About</h3>" |
29 | echo "This little App should make it possible for you to " | 29 | echo "This little App should make it possible for you to " |
30 | echo "easily have a look at some of the syslogs. " | 30 | echo "easily have a look at some of the syslogs. " |
31 | echo "<p>" | 31 | echo "<p>" |
32 | ) | $OPIE_SH -t logviewer -f & | 32 | ) | $OPIE_SH -t logviewer -f & |
33 | SCREENCLEAN=$! | 33 | SCREENCLEAN=$! |
34 | sleep 1 | 34 | sleep 1 |
35 | } | 35 | } |
36 | 36 | ||
37 | cleanup() { | 37 | cleanup() { |
38 | kill $SCREENCLEAN 2>/dev/null | 38 | kill $SCREENCLEAN 2>/dev/null |
39 | rm -f /tmp/qcop-msg-logviewer.sh | 39 | rm -f /tmp/qcop-msg-logviewer.sh |
40 | } | 40 | } |
41 | 41 | ||
42 | choose_log() { | 42 | choose_log() { |
43 | # ask what to do (start/stop/status) | 43 | # ask what to do (start/stop/status) |
44 | # | 44 | # |
45 | $OPIE_SH -m -t "Select Log" \ | 45 | $OPIE_SH -m -t "Select Log" \ |
46 | -M "which logfile are you interested in ?<br>" \ | 46 | -M "which logfile are you interested in ?<br>" \ |
47 | -g -0 "PROC" -1 "SYSLOG" | 47 | -g -0 "PROC" -1 "SYSLOG" |
48 | RETURNCODE=$? | 48 | RETURNCODE=$? |
49 | 49 | ||
50 | case $RETURNCODE in | 50 | case $RETURNCODE in |
51 | -1) echo unexpected input detected, exiting. | 51 | -1) echo unexpected input detected, exiting. |
52 | cleanup ;; | 52 | cleanup ;; |
53 | 0) LOGMETHOD=proc ;; | 53 | 0) LOGMETHOD=proc ;; |
54 | 1) LOGMETHOD=syslog ;; | 54 | 1) LOGMETHOD=syslog ;; |
55 | esac | 55 | esac |
56 | } | 56 | } |
57 | 57 | ||
58 | ###################################################################### | 58 | ###################################################################### |
59 | # main | 59 | # main |
60 | 60 | ||
61 | about | 61 | about |
62 | choose_log | 62 | choose_log |
63 | 63 | ||
64 | case $LOGMETHOD in | 64 | case $LOGMETHOD in |
65 | proc) $OPIE_SH -m -t "Select Log" \ | 65 | proc) $OPIE_SH -m -t "Select Log" \ |
66 | -M "which procfile ?<br>" \ | 66 | -M "which procfile ?<br>" \ |
67 | -g -0 kmsg -1 "ksyms" | 67 | -g -0 kmsg -1 "ksyms" |
68 | RETURNCODE=$? | 68 | RETURNCODE=$? |
69 | case $RETURNCODE in | 69 | case $RETURNCODE in |
70 | -1) cleanup ;; | 70 | -1) cleanup ;; |
71 | 0) | 71 | 0) |
72 | 72 | ||
73 | cat /proc/kmsg >/tmp/log.$$ & | 73 | cat /proc/kmsg >/tmp/log.$$ & |
74 | PID=$! | 74 | PID=$! |
75 | sleep 2 | 75 | sleep 2 |
76 | kill $PID | 76 | kill $PID |
77 | ( echo "<img src=/opt/QtPalmtop/pics/opie-sh-scripts/logviewer.png>" | 77 | ( echo "<img src=$OPIEDIR/pics/opie-sh-scripts/logviewer.png>" |
78 | echo "<h3>/proc/kmsg</h3>" | 78 | echo "<h3>/proc/kmsg</h3>" |
79 | cat /tmp/log.$$ | 79 | cat /tmp/log.$$ |
80 | ) | $OPIE_SH -t kmsg -f | 80 | ) | $OPIE_SH -t kmsg -f |
81 | rm -f /tmp/$$ | 81 | rm -f /tmp/$$ |
82 | cleanup ;; | 82 | cleanup ;; |
83 | 83 | ||
84 | 1) | 84 | 1) |
85 | 85 | ||
86 | cat /proc/ksyms >/tmp/log.$$ & | 86 | cat /proc/ksyms >/tmp/log.$$ & |
87 | PID=$! | 87 | PID=$! |
88 | sleep 2 | 88 | sleep 2 |
89 | kill $PID | 89 | kill $PID |
90 | ( echo "<img src=/opt/QtPalmtop/pics/opie-sh-scripts/logviewer.png>" | 90 | ( echo "<img src=$OPIEDIR/pics/opie-sh-scripts/logviewer.png>" |
91 | echo "<h3>/proc/ksyms</h3>" | 91 | echo "<h3>/proc/ksyms</h3>" |
92 | cat /tmp/log.$$ | 92 | cat /tmp/log.$$ |
93 | ) | $OPIE_SH -t ksyms -f | 93 | ) | $OPIE_SH -t ksyms -f |
94 | rm -f /tmp/$$ | 94 | rm -f /tmp/$$ |
95 | cleanup ;; | 95 | cleanup ;; |
96 | 96 | ||
97 | *) cleanup ;; | 97 | *) cleanup ;; |
98 | esac | 98 | esac |
99 | cleanup ;; | 99 | cleanup ;; |
100 | 100 | ||
101 | syslog) | 101 | syslog) |
102 | 102 | ||
103 | if [ -f /var/log/messages ] | 103 | if [ -f /var/log/messages ] |
104 | then | 104 | then |
105 | $OPIE_SH -t syslog -f /var/log/messages | 105 | $OPIE_SH -t syslog -f /var/log/messages |
106 | else | 106 | else |
107 | echo "no syslogd installed or /var/log/messages inexistent." \ | 107 | echo "no syslogd installed or /var/log/messages inexistent." \ |
108 | | $OPIE_SH -t syslog -f | 108 | | $OPIE_SH -t syslog -f |
109 | fi | 109 | fi |
110 | ;; | 110 | ;; |
111 | *) cleanup ;; | 111 | *) cleanup ;; |
112 | esac | 112 | esac |
113 | 113 | ||
114 | 114 | ||
115 | cleanup | 115 | cleanup |
116 | 116 | ||
diff --git a/noncore/tools/opie-sh/scripts/opie-sh-ssh-askpass.sh b/noncore/tools/opie-sh/scripts/opie-sh-ssh-askpass.sh index 7e1e7ad..7d13345 100755 --- a/noncore/tools/opie-sh/scripts/opie-sh-ssh-askpass.sh +++ b/noncore/tools/opie-sh/scripts/opie-sh-ssh-askpass.sh | |||
@@ -1,8 +1,8 @@ | |||
1 | #!/bin/sh | 1 | #!/bin/sh |
2 | 2 | ||
3 | # opie-sh-ssh-askpass -- ssh-askpass utility using opie-sh | 3 | # opie-sh-ssh-askpass -- ssh-askpass utility using opie-sh |
4 | 4 | ||
5 | OPIE_SH=opie-sh | 5 | OPIE_SH=$OPIEDIR/bin/opie-sh |
6 | 6 | ||
7 | exec $OPIE_SH -i -p -t "OpenSSH" -g -L "<SMALL>$@" 2>/dev/null | 7 | exec $OPIE_SH -i -p -t "OpenSSH" -g -L "<SMALL>$@" 2>/dev/null |
8 | 8 | ||
diff --git a/noncore/tools/opie-sh/scripts/opie-sh-wavelanchooser.sh b/noncore/tools/opie-sh/scripts/opie-sh-wavelanchooser.sh index 13a1e79..49c62c4 100755 --- a/noncore/tools/opie-sh/scripts/opie-sh-wavelanchooser.sh +++ b/noncore/tools/opie-sh/scripts/opie-sh-wavelanchooser.sh | |||
@@ -1,62 +1,62 @@ | |||
1 | #!/bin/sh | 1 | #!/bin/sh |
2 | 2 | ||
3 | # wavelanchooser.sh - a demonstration of opie-sh | 3 | # wavelanchooser.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 | # 20020528-1 - fixed filename in cleanup | 17 | # 20020528-1 - fixed filename in cleanup |
18 | # 20020526-1 - rudimental but working | 18 | # 20020526-1 - rudimental but working |
19 | # 20020524-1 - initial working release planned | 19 | # 20020524-1 - initial working release planned |
20 | # | 20 | # |
21 | 21 | ||
22 | OPIE_SH=opie-sh | 22 | OPIE_SH=$OPIEDIR/bin/opie-sh |
23 | 23 | ||
24 | about() { | 24 | about() { |
25 | ( echo "<img src=/opt/QtPalmtop/pics/opie-sh-scripts/qtwavelan.png>" | 25 | ( echo "<img src=$OPIEDIR/pics/opie-sh-scripts/qtwavelan.png>" |
26 | echo "<h3>About</h3>" | 26 | echo "<h3>About</h3>" |
27 | echo "This little App is for changing the location setting" | 27 | echo "This little App is for changing the location setting" |
28 | echo "for your wireless card. <br>" | 28 | echo "for your wireless card. <br>" |
29 | echo "actually it only starts /etc/init.d/[home|work] and can" | 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" | 30 | echo "be easily turned into a quick program to start the service" |
31 | echo "or init script you use most." | 31 | echo "or init script you use most." |
32 | echo "<p>" | 32 | echo "<p>" |
33 | ) | $OPIE_SH -t wavelanchooser -f & | 33 | ) | $OPIE_SH -t wavelanchooser -f & |
34 | SCREENCLEAN=$! | 34 | SCREENCLEAN=$! |
35 | sleep 1 | 35 | sleep 1 |
36 | } | 36 | } |
37 | 37 | ||
38 | cleanup() { | 38 | cleanup() { |
39 | kill $SCREENCLEAN $SCREENCLEAN2 | 39 | kill $SCREENCLEAN $SCREENCLEAN2 |
40 | rm -f /tmp/qcop-msg-opie-sh-wavelanchooser.sh | 40 | rm -f /tmp/qcop-msg-opie-sh-wavelanchooser.sh |
41 | } | 41 | } |
42 | 42 | ||
43 | 43 | ||
44 | about | 44 | about |
45 | 45 | ||
46 | # choose if work or home | 46 | # choose if work or home |
47 | $OPIE_SH -m -t "network-settings dialog" \ | 47 | $OPIE_SH -m -t "network-settings dialog" \ |
48 | -M "which configuration do you want ? " \ | 48 | -M "which configuration do you want ? " \ |
49 | -w -0 home -1 work -g | 49 | -w -0 home -1 work -g |
50 | 50 | ||
51 | if [ "$?" = "0" ] | 51 | if [ "$?" = "0" ] |
52 | thenDECISION=home | 52 | thenDECISION=home |
53 | elseDECISION=work | 53 | elseDECISION=work |
54 | fi | 54 | fi |
55 | 55 | ||
56 | ( echo "you decided to choose $DECISION configuration. " | 56 | ( echo "you decided to choose $DECISION configuration. " |
57 | echo "remember to reinsert card." | 57 | echo "remember to reinsert card." |
58 | /etc/init.d/$DECISION start | 58 | /etc/init.d/$DECISION start |
59 | ) | $OPIE_SH -t "confirmation" -f \ | 59 | ) | $OPIE_SH -t "confirmation" -f \ |
60 | 60 | ||
61 | 61 | ||
62 | cleanup | 62 | cleanup |
diff --git a/noncore/tools/opie-sh/scripts/rsyncme.sh b/noncore/tools/opie-sh/scripts/rsyncme.sh index c09aea8..3d56c12 100755 --- a/noncore/tools/opie-sh/scripts/rsyncme.sh +++ b/noncore/tools/opie-sh/scripts/rsyncme.sh | |||
@@ -1,109 +1,109 @@ | |||
1 | #!/bin/sh | 1 | #!/bin/sh |
2 | 2 | ||
3 | # rsyncme.sh - a demonstration of opie-sh | 3 | # rsyncme.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 | # 20020517-1 - added icon, changed name in launcher | 17 | # 20020517-1 - added icon, changed name in launcher |
18 | # | 18 | # |
19 | 19 | ||
20 | CFG=/opt/QtPalmtop/share/config/rsyncme.cfg | 20 | CFG=$OPIEDIR/share/config/rsyncme.cfg |
21 | OPIE_SH=opie-sh | 21 | OPIE_SH=$OPIEDIR/bin/opie-sh |
22 | 22 | ||
23 | update_cfg() { | 23 | update_cfg() { |
24 | # check if dir is in CFG and if not add it | 24 | # check if dir is in CFG and if not add it |
25 | if [ "`grep -c $DIR $CFG`" = "0" ] | 25 | if [ "`grep -c $DIR $CFG`" = "0" ] |
26 | thenecho $DIR >>$CFG | 26 | thenecho $DIR >>$CFG |
27 | fi | 27 | fi |
28 | } | 28 | } |
29 | 29 | ||
30 | ask_dirs() { | 30 | ask_dirs() { |
31 | # get source and destination dir | 31 | # get source and destination dir |
32 | DIR=`$OPIE_SH -g -i -t "Choose Source Directory" -l -L DIR: -E -F $CFG ` | 32 | DIR=`$OPIE_SH -g -i -t "Choose Source Directory" -l -L DIR: -E -F $CFG ` |
33 | update_cfg | 33 | update_cfg |
34 | SRCDIR=$DIR | 34 | SRCDIR=$DIR |
35 | 35 | ||
36 | DIR=`$OPIE_SH -g -i -t "Choose Destination Directory" -l -L DIR: -E -F $CFG ` | 36 | DIR=`$OPIE_SH -g -i -t "Choose Destination Directory" -l -L DIR: -E -F $CFG ` |
37 | update_cfg | 37 | update_cfg |
38 | DESTDIR=$DIR | 38 | DESTDIR=$DIR |
39 | } | 39 | } |
40 | 40 | ||
41 | ask_options() { | 41 | ask_options() { |
42 | # now ask for options | 42 | # now ask for options |
43 | OPTIONS="--archive --verbose --checksum --recursive --update --links --partial --dry-run --rsh=ssh --existing --compress --recursive" | 43 | OPTIONS="--archive --verbose --checksum --recursive --update --links --partial --dry-run --rsh=ssh --existing --compress --recursive" |
44 | OUTPUT=`( for OPTION in $OPTIONS | 44 | OUTPUT=`( for OPTION in $OPTIONS |
45 | do | 45 | do |
46 | echo "$OPTION" | 46 | echo "$OPTION" |
47 | done ) | $OPIE_SH -t "Select options" -g -i -b -F ` | 47 | done ) | $OPIE_SH -t "Select options" -g -i -b -F ` |
48 | } | 48 | } |
49 | 49 | ||
50 | rsync_output() { | 50 | rsync_output() { |
51 | ( echo "<h3>Output of your rsync:</h3>" | 51 | ( echo "<h3>Output of your rsync:</h3>" |
52 | echo "command: rsync $OUTPUT $SRCDIR $DESTDIR" | 52 | echo "command: rsync $OUTPUT $SRCDIR $DESTDIR" |
53 | echo "<pre>" | 53 | echo "<pre>" |
54 | rsync $OUTPUT $SRCDIR $DESTDIR 2>&1 | 54 | rsync $OUTPUT $SRCDIR $DESTDIR 2>&1 |
55 | echo "</pre>done." | 55 | echo "</pre>done." |
56 | ) | $OPIE_SH -t "Result:" -f | 56 | ) | $OPIE_SH -t "Result:" -f |
57 | } | 57 | } |
58 | 58 | ||
59 | cleanup() { | 59 | cleanup() { |
60 | kill $SCREENCLEAN | 60 | kill $SCREENCLEAN |
61 | rm -f /tmp/qcop-msg-rsyncme.sh | 61 | rm -f /tmp/qcop-msg-rsyncme.sh |
62 | } | 62 | } |
63 | 63 | ||
64 | show_dirs() { | 64 | show_dirs() { |
65 | ( echo "<h3>Directorys chosen for sync:</h3>" | 65 | ( echo "<h3>Directorys chosen for sync:</h3>" |
66 | echo "<ul><li>$SRCDIR<li>$DESTDIR</ul>" ) \ | 66 | echo "<ul><li>$SRCDIR<li>$DESTDIR</ul>" ) \ |
67 | | $OPIE_SH -t "Got directories" -f | 67 | | $OPIE_SH -t "Got directories" -f |
68 | } | 68 | } |
69 | 69 | ||
70 | about() { | 70 | about() { |
71 | ( echo "<img src=/opt/QtPalmtop/pics/opie-sh-scripts/rsyncme.png>" | 71 | ( echo "<img src=$OPIEDIR/pics/opie-sh-scripts/rsyncme.png>" |
72 | echo "<h3>About</h3>" | 72 | echo "<h3>About</h3>" |
73 | echo "This little App should make it possible for you to " | 73 | echo "This little App should make it possible for you to " |
74 | echo "easily choose the wanted options for an rsync process." | 74 | echo "easily choose the wanted options for an rsync process." |
75 | echo "<p>" | 75 | echo "<p>" |
76 | ) | $OPIE_SH -t rsync-helper -f & | 76 | ) | $OPIE_SH -t rsync-helper -f & |
77 | SCREENCLEAN=$! | 77 | SCREENCLEAN=$! |
78 | sleep 1 | 78 | sleep 1 |
79 | } | 79 | } |
80 | 80 | ||
81 | 81 | ||
82 | 82 | ||
83 | 83 | ||
84 | ##################################################################### | 84 | ##################################################################### |
85 | # | 85 | # |
86 | # main | 86 | # main |
87 | 87 | ||
88 | about | 88 | about |
89 | 89 | ||
90 | # ask to: start rsync, edit dirlist, show about | 90 | # ask to: start rsync, edit dirlist, show about |
91 | $OPIE_SH -m -g -t RsyncMe -M "Welcome!" -0 Start -1 Dirlist | 91 | $OPIE_SH -m -g -t RsyncMe -M "Welcome!" -0 Start -1 Dirlist |
92 | RETURNCODE=$? | 92 | RETURNCODE=$? |
93 | case $RETURNCODE in | 93 | case $RETURNCODE in |
94 | -1)echo died unexpectedly... | $OPIE_SH -f | 94 | -1)echo died unexpectedly... | $OPIE_SH -f |
95 | cleanup | 95 | cleanup |
96 | exit ;; | 96 | exit ;; |
97 | 1) textedit $CFG | 97 | 1) textedit $CFG |
98 | cleanup ;; | 98 | cleanup ;; |
99 | 0)if [ -f $CFG ] | 99 | 0)if [ -f $CFG ] |
100 | thenask_dirs | 100 | thenask_dirs |
101 | show_dirs | 101 | show_dirs |
102 | ask_options | 102 | ask_options |
103 | rsync_output | 103 | rsync_output |
104 | else ( echo no config file seems to exist - see About... ) \ | 104 | else ( echo no config file seems to exist - see About... ) \ |
105 | | $OPIE_SH -t "SORRY..." -f | 105 | | $OPIE_SH -t "SORRY..." -f |
106 | fi | 106 | fi |
107 | cleanup | 107 | cleanup |
108 | ;; | 108 | ;; |
109 | esac | 109 | esac |
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,110 +1,110 @@ | |||
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 | ||
22 | OPIE_SH=/opt/QtPalmtop/bin/opie-sh | 22 | OPIE_SH=$OPIEDIR/bin/opie-sh |
23 | INITPATH=/etc/init.d | 23 | INITPATH=/etc/init.d |
24 | 24 | ||
25 | ###################################################################### | 25 | ###################################################################### |
26 | # subroutines | 26 | # subroutines |
27 | 27 | ||
28 | about() { | 28 | about() { |
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 | ||
39 | cleanup() { | 39 | cleanup() { |
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 | ||
44 | get_action() { | 44 | get_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 | ||
61 | status_disclaimer() { | 61 | status_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... |
75 | EOT | 75 | EOT |
76 | } | 76 | } |
77 | 77 | ||
78 | select_service() { | 78 | select_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 |
90 | 90 | ||
91 | about | 91 | about |
92 | select_service | 92 | select_service |
93 | get_action | 93 | get_action |
94 | 94 | ||
95 | if [ "$SERVICE" = "" ] | 95 | if [ "$SERVICE" = "" ] |
96 | then cleanup ; exit | 96 | then cleanup ; exit |
97 | fi | 97 | fi |
98 | 98 | ||
99 | if [ "$ACTION" = "status" ] | 99 | if [ "$ACTION" = "status" ] |
100 | then status_disclaimer | 100 | then status_disclaimer |
101 | else ( echo "<h3>Output of $INITPATH/$SERVICE $ACTION:</h3>" | 101 | else ( echo "<h3>Output of $INITPATH/$SERVICE $ACTION:</h3>" |
102 | echo "<pre>" | 102 | echo "<pre>" |
103 | $INITPATH/$SERVICE $ACTION | 103 | $INITPATH/$SERVICE $ACTION |
104 | echo "</pre><p>" | 104 | echo "</pre><p>" |
105 | echo done. | 105 | echo done. |
106 | ) | $OPIE_SH -f | 106 | ) | $OPIE_SH -f |
107 | fi | 107 | fi |
108 | 108 | ||
109 | cleanup | 109 | cleanup |
110 | 110 | ||
diff --git a/noncore/tools/opie-sh/scripts/stowctrl.sh b/noncore/tools/opie-sh/scripts/stowctrl.sh index 475c3a3..20cb6ae 100755 --- a/noncore/tools/opie-sh/scripts/stowctrl.sh +++ b/noncore/tools/opie-sh/scripts/stowctrl.sh | |||
@@ -1,84 +1,84 @@ | |||
1 | #!/bin/sh | 1 | #!/bin/sh |
2 | 2 | ||
3 | #stowctrl.sh - modified usbnetctrl.sh from gonz by spiralman spiralman@softhome.net | 3 | #stowctrl.sh - modified usbnetctrl.sh from gonz by spiralman spiralman@softhome.net |
4 | # usbnetctrl.sh - a demonstration of opie-sh | 4 | # usbnetctrl.sh - a demonstration of opie-sh |
5 | # | 5 | # |
6 | # Copyright (C) 2002 gonz@directbox.com | 6 | # Copyright (C) 2002 gonz@directbox.com |
7 | # | 7 | # |
8 | # This program is free software; you can redistribute it and/or modify | 8 | # This program is free software; you can redistribute it and/or modify |
9 | # it under the terms of the GNU General Public License as published by | 9 | # it under the terms of the GNU General Public License as published by |
10 | # the Free Software Foundation; either version 2, or (at your option) | 10 | # the Free Software Foundation; either version 2, or (at your option) |
11 | # any later version. | 11 | # any later version. |
12 | # | 12 | # |
13 | # This program is distributed in the hope that it will be useful, | 13 | # This program is distributed in the hope that it will be useful, |
14 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | 14 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
16 | # GNU General Public License for more details. | 16 | # GNU General Public License for more details. |
17 | # | 17 | # |
18 | # 20020524-1 - code beautification, added icons and reset | 18 | # 20020524-1 - code beautification, added icons and reset |
19 | # 20020517-2 - bugfixed fullscreen, added info about ifconfig | 19 | # 20020517-2 - bugfixed fullscreen, added info about ifconfig |
20 | # 20020517-1 - added about, fullscreen and icon | 20 | # 20020517-1 - added about, fullscreen and icon |
21 | 21 | ||
22 | OPIE_SH=/opt/QtPalmtop/bin/opie-sh | 22 | OPIE_SH=$OPIEDIR/bin/opie-sh |
23 | 23 | ||
24 | ###################################################################### | 24 | ###################################################################### |
25 | # subroutines | 25 | # subroutines |
26 | 26 | ||
27 | about() { | 27 | about() { |
28 | ( echo "<img src=/opt/QtPalmtop/pics/opie-sh-scripts/stowctrl.png>" | 28 | ( echo "<img src=$OPIEDIR/pics/opie-sh-scripts/stowctrl.png>" |
29 | echo "<h3>About</h3>" | 29 | echo "<h3>About</h3>" |
30 | echo "This little App should make it easy for you to " | 30 | echo "This little App should make it easy for you to " |
31 | echo "activate / deactivate the stowaway keyboard (on ipaq)" | 31 | echo "activate / deactivate the stowaway keyboard (on ipaq)" |
32 | echo "<p>" | 32 | echo "<p>" |
33 | ) | $OPIE_SH -t "stowaway control" -f & | 33 | ) | $OPIE_SH -t "stowaway control" -f & |
34 | SCREENCLEAN=$! | 34 | SCREENCLEAN=$! |
35 | sleep 1 | 35 | sleep 1 |
36 | } | 36 | } |
37 | 37 | ||
38 | startup() { | 38 | startup() { |
39 | echo "<img src=/opt/QtPalmtop/pics/opie-sh-scripts/stowctrl.png>" > /tmp/sout | 39 | echo "<img src=$OPIEDIR/pics/opie-sh-scripts/stowctrl.png>" > /tmp/sout |
40 | echo "<h3>stowaway up</h3>" >> /tmp/sout | 40 | echo "<h3>stowaway up</h3>" >> /tmp/sout |
41 | modprobe h3600_stowaway >> /tmp/sout | 41 | modprobe h3600_stowaway >> /tmp/sout |
42 | cat /dev/stowaway & | 42 | cat /dev/stowaway & |
43 | echo $! > /tmp/stowcatpid | 43 | echo $! > /tmp/stowcatpid |
44 | $OPIE_SH -t Output -f /tmp/sout | 44 | $OPIE_SH -t Output -f /tmp/sout |
45 | rm /tmp/sout | 45 | rm /tmp/sout |
46 | } | 46 | } |
47 | 47 | ||
48 | stopit() { | 48 | stopit() { |
49 | ( echo "<img src=/opt/QtPalmtop/pics/opie-sh-scripts/stowctrl.png>" | 49 | ( echo "<img src=$OPIEDIR/pics/opie-sh-scripts/stowctrl.png>" |
50 | echo "<h3>stowaway down</h3>" | 50 | echo "<h3>stowaway down</h3>" |
51 | read THECAT < /tmp/stowcatpid | 51 | read THECAT < /tmp/stowcatpid |
52 | kill $THECAT | 52 | kill $THECAT |
53 | rmmod h3600_stowaway | 53 | rmmod h3600_stowaway |
54 | ) 2>&1 | $OPIE_SH -t Output -f | 54 | ) 2>&1 | $OPIE_SH -t Output -f |
55 | } | 55 | } |
56 | 56 | ||
57 | 57 | ||
58 | cleanup() { | 58 | cleanup() { |
59 | kill $SCREENCLEAN | 59 | kill $SCREENCLEAN |
60 | rm -f /tmp/qcop-msg-stowctrl.sh | 60 | rm -f /tmp/qcop-msg-stowctrl.sh |
61 | } | 61 | } |
62 | 62 | ||
63 | 63 | ||
64 | yesorno() { | 64 | yesorno() { |
65 | $OPIE_SH -m -t "Stowaway Up/Down" -M "What to do with the Stowaway: " \ | 65 | $OPIE_SH -m -t "Stowaway Up/Down" -M "What to do with the Stowaway: " \ |
66 | -g -0 Up -1 Down -2 Restart | 66 | -g -0 Up -1 Down -2 Restart |
67 | RETURNCODE=$? | 67 | RETURNCODE=$? |
68 | 68 | ||
69 | case $RETURNCODE in | 69 | case $RETURNCODE in |
70 | -1) echo error... | 70 | -1) echo error... |
71 | cleanup | 71 | cleanup |
72 | exit ;; | 72 | exit ;; |
73 | 0) startup ;; | 73 | 0) startup ;; |
74 | 1) stopit ;; | 74 | 1) stopit ;; |
75 | 2) stopit ; sleep 1 ; startup ;; | 75 | 2) stopit ; sleep 1 ; startup ;; |
76 | esac | 76 | esac |
77 | } | 77 | } |
78 | 78 | ||
79 | ###################################################################### | 79 | ###################################################################### |
80 | # main | 80 | # main |
81 | 81 | ||
82 | about | 82 | about |
83 | yesorno | 83 | yesorno |
84 | cleanup | 84 | cleanup |
diff --git a/noncore/tools/opie-sh/scripts/usbnetctrl.sh b/noncore/tools/opie-sh/scripts/usbnetctrl.sh index 417435e..af68a3d 100755 --- a/noncore/tools/opie-sh/scripts/usbnetctrl.sh +++ b/noncore/tools/opie-sh/scripts/usbnetctrl.sh | |||
@@ -1,94 +1,94 @@ | |||
1 | #!/bin/sh | 1 | #!/bin/sh |
2 | 2 | ||
3 | # usbnetctrl.sh - a demonstration of opie-sh | 3 | # usbnetctrl.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 beautification, added icons and reset | 17 | # 20020524-1 - code beautification, added icons and reset |
18 | # 20020517-2 - bugfixed fullscreen, added info about ifconfig | 18 | # 20020517-2 - bugfixed fullscreen, added info about ifconfig |
19 | # 20020517-1 - added about, fullscreen and icon | 19 | # 20020517-1 - added about, fullscreen and 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/usbnetctrl.png>" | 27 | ( echo "<img src=$OPIEDIR/pics/opie-sh-scripts/usbnetctrl.png>" |
28 | echo "<h3>About</h3>" | 28 | echo "<h3>About</h3>" |
29 | echo "This little App should make it easy for you to " | 29 | echo "This little App should make it easy for you to " |
30 | echo "activate / deactivate the usbnet-driver (on ipaq)" | 30 | echo "activate / deactivate the usbnet-driver (on ipaq)" |
31 | echo "<p>" | 31 | echo "<p>" |
32 | echo "To use it at first, you need to change the ifconfig" | 32 | echo "To use it at first, you need to change the ifconfig" |
33 | echo "line in /opt/QtPalmtop/bin/usbnetctrl.sh." | 33 | echo "line in $OPIEDIR/bin/usbnetctrl.sh." |
34 | ) | $OPIE_SH -t "usbnet control" -f & | 34 | ) | $OPIE_SH -t "usbnet control" -f & |
35 | SCREENCLEAN=$! | 35 | SCREENCLEAN=$! |
36 | sleep 1 | 36 | sleep 1 |
37 | } | 37 | } |
38 | 38 | ||
39 | startup() { | 39 | startup() { |
40 | ( echo "<img src=/opt/QtPalmtop/pics/opie-sh-scripts/usbnetctrl.png>" | 40 | ( echo "<img src=$OPIEDIR/pics/opie-sh-scripts/usbnetctrl.png>" |
41 | echo "<h3>usbnet up</h3>" | 41 | echo "<h3>usbnet up</h3>" |
42 | modprobe usb-eth | 42 | modprobe usb-eth |
43 | ) 2>&1 | $OPIE_SH -t Output -f | 43 | ) 2>&1 | $OPIE_SH -t Output -f |
44 | 44 | ||
45 | $OPIE_SH -m -I -t "Usbnet Control" -M "Please connect the<br>ipaq to the cradle<br>and press OK" | 45 | $OPIE_SH -m -I -t "Usbnet Control" -M "Please connect the<br>ipaq to the cradle<br>and press OK" |
46 | 46 | ||
47 | ( echo "<img src=/opt/QtPalmtop/pics/opie-sh-scripts/usbnetctrl.png>" | 47 | ( echo "<img src=$OPIEDIR/pics/opie-sh-scripts/usbnetctrl.png>" |
48 | echo "<h3>usbnet up</h3>" | 48 | echo "<h3>usbnet up</h3>" |
49 | ifconfig usbf up 192.168.0.1 netmask 255.255.255.0 | 49 | ifconfig usbf up 192.168.0.1 netmask 255.255.255.0 |
50 | 50 | ||
51 | ) 2>&1 | $OPIE_SH -t Output -f | 51 | ) 2>&1 | $OPIE_SH -t Output -f |
52 | if [ -f /root/masq.sh ] | 52 | if [ -f /root/masq.sh ] |
53 | then sh /root/masq.sh | 53 | then sh /root/masq.sh |
54 | fi | 54 | fi |
55 | } | 55 | } |
56 | 56 | ||
57 | stopit() { | 57 | stopit() { |
58 | ( echo "<img src=/opt/QtPalmtop/pics/opie-sh-scripts/usbnetctrl.png>" | 58 | ( echo "<img src=$OPIEDIR/pics/opie-sh-scripts/usbnetctrl.png>" |
59 | echo "<h3>usbnet down</h3>" | 59 | echo "<h3>usbnet down</h3>" |
60 | ifconfig usbf down | 60 | ifconfig usbf down |
61 | sleep 1 | 61 | sleep 1 |
62 | rmmod usb-eth | 62 | rmmod usb-eth |
63 | rmmod sa1100usb_core | 63 | rmmod sa1100usb_core |
64 | ) 2>&1 | $OPIE_SH -t Output -f | 64 | ) 2>&1 | $OPIE_SH -t Output -f |
65 | } | 65 | } |
66 | 66 | ||
67 | 67 | ||
68 | cleanup() { | 68 | cleanup() { |
69 | kill $SCREENCLEAN | 69 | kill $SCREENCLEAN |
70 | rm -f /tmp/qcop-msg-usbnetctrl.sh | 70 | rm -f /tmp/qcop-msg-usbnetctrl.sh |
71 | } | 71 | } |
72 | 72 | ||
73 | 73 | ||
74 | yesorno() { | 74 | yesorno() { |
75 | $OPIE_SH -m -t "USB-Net start/stop" -M "What to do with usbnet: " \ | 75 | $OPIE_SH -m -t "USB-Net start/stop" -M "What to do with usbnet: " \ |
76 | -g -0 Start -1 Stop -2 Restart | 76 | -g -0 Start -1 Stop -2 Restart |
77 | RETURNCODE=$? | 77 | RETURNCODE=$? |
78 | 78 | ||
79 | case $RETURNCODE in | 79 | case $RETURNCODE in |
80 | -1) echo error... | 80 | -1) echo error... |
81 | cleanup | 81 | cleanup |
82 | exit ;; | 82 | exit ;; |
83 | 0) startup ;; | 83 | 0) startup ;; |
84 | 1) stopit ;; | 84 | 1) stopit ;; |
85 | 2) stopit ; sleep 1 ; startup ;; | 85 | 2) stopit ; sleep 1 ; startup ;; |
86 | esac | 86 | esac |
87 | } | 87 | } |
88 | 88 | ||
89 | ###################################################################### | 89 | ###################################################################### |
90 | # main | 90 | # main |
91 | 91 | ||
92 | about | 92 | about |
93 | yesorno | 93 | yesorno |
94 | cleanup | 94 | cleanup |