32 files changed, 914 insertions, 0 deletions
diff --git a/apps/Opie-SH/diskfree.desktop b/apps/Opie-SH/diskfree.desktop new file mode 100644 index 0000000..33a532c --- a/dev/null +++ b/apps/Opie-SH/diskfree.desktop | |||
@@ -0,0 +1,5 @@ | |||
1 | [Desktop Entry] | ||
2 | Type=Application | ||
3 | Exec=diskfree.sh | ||
4 | Icon=diskfree | ||
5 | Name=Disk Free | ||
diff --git a/apps/Opie-SH/filesystem_mounter.desktop b/apps/Opie-SH/filesystem_mounter.desktop new file mode 100644 index 0000000..673f738 --- a/dev/null +++ b/apps/Opie-SH/filesystem_mounter.desktop | |||
@@ -0,0 +1,5 @@ | |||
1 | [Desktop Entry] | ||
2 | Type=Application | ||
3 | Exec=filesystem_mounter.sh | ||
4 | Icon=fsmounter | ||
5 | Name=Filesystem Mounter | ||
diff --git a/apps/Opie-SH/hostlist.desktop b/apps/Opie-SH/hostlist.desktop new file mode 100644 index 0000000..4ec02ae --- a/dev/null +++ b/apps/Opie-SH/hostlist.desktop | |||
@@ -0,0 +1,6 @@ | |||
1 | [Desktop Entry] | ||
2 | Comment=hostlist | ||
3 | Exec=hostlist.sh | ||
4 | Icon=hostlist | ||
5 | Type=Application | ||
6 | Name=Hostlist | ||
diff --git a/apps/Opie-SH/killproc.desktop b/apps/Opie-SH/killproc.desktop new file mode 100644 index 0000000..b9b7d5e --- a/dev/null +++ b/apps/Opie-SH/killproc.desktop | |||
@@ -0,0 +1,5 @@ | |||
1 | [Desktop Entry] | ||
2 | Type=Application | ||
3 | Exec=killproc.sh | ||
4 | Icon=killproc | ||
5 | Name=Process Killer | ||
diff --git a/apps/Opie-SH/launcher_refresh.desktop b/apps/Opie-SH/launcher_refresh.desktop new file mode 100644 index 0000000..bce86a3 --- a/dev/null +++ b/apps/Opie-SH/launcher_refresh.desktop | |||
@@ -0,0 +1,6 @@ | |||
1 | [Desktop Entry] | ||
2 | Comment=launcher_refresh | ||
3 | Exec=launcher_refresh.sh | ||
4 | Icon=launcher_refresh | ||
5 | Type=Application | ||
6 | Name=Launcher Refresh | ||
diff --git a/apps/Opie-SH/logviewer.desktop b/apps/Opie-SH/logviewer.desktop new file mode 100644 index 0000000..dc87376 --- a/dev/null +++ b/apps/Opie-SH/logviewer.desktop | |||
@@ -0,0 +1,5 @@ | |||
1 | [Desktop Entry] | ||
2 | Type=Application | ||
3 | Exec=logviewer.sh | ||
4 | Icon=logviewer | ||
5 | Name=Log Viewer | ||
diff --git a/apps/Opie-SH/opie-sh-wavelanchooser.desktop b/apps/Opie-SH/opie-sh-wavelanchooser.desktop new file mode 100644 index 0000000..9162cda --- a/dev/null +++ b/apps/Opie-SH/opie-sh-wavelanchooser.desktop | |||
@@ -0,0 +1,6 @@ | |||
1 | [Desktop Entry] | ||
2 | Comment=WLAN Chooser | ||
3 | Exec=wavelanchooser.sh | ||
4 | Icon=qtwavelan | ||
5 | Type=Application | ||
6 | Name=WLAN Chooser | ||
diff --git a/apps/Opie-SH/rsyncme.desktop b/apps/Opie-SH/rsyncme.desktop new file mode 100644 index 0000000..288d233 --- a/dev/null +++ b/apps/Opie-SH/rsyncme.desktop | |||
@@ -0,0 +1,6 @@ | |||
1 | [Desktop Entry] | ||
2 | Comment=rsync helper | ||
3 | Exec=rsyncme.sh | ||
4 | Icon=rsyncme | ||
5 | Type=Application | ||
6 | Name=RSYNC Helper | ||
diff --git a/apps/Opie-SH/service_manager.desktop b/apps/Opie-SH/service_manager.desktop new file mode 100644 index 0000000..4d4ef13 --- a/dev/null +++ b/apps/Opie-SH/service_manager.desktop | |||
@@ -0,0 +1,5 @@ | |||
1 | [Desktop Entry] | ||
2 | Type=Application | ||
3 | Exec=service_manager.sh | ||
4 | Icon=service_manager | ||
5 | Name=Service Manager | ||
diff --git a/apps/Opie-SH/usbnetctrl.desktop b/apps/Opie-SH/usbnetctrl.desktop new file mode 100644 index 0000000..a383f0c --- a/dev/null +++ b/apps/Opie-SH/usbnetctrl.desktop | |||
@@ -0,0 +1,5 @@ | |||
1 | [Desktop Entry] | ||
2 | Type=Application | ||
3 | Exec=usbnetctrl.sh | ||
4 | Icon=usbnetctrl | ||
5 | Name=USBNET Control | ||
diff --git a/noncore/tools/opie-sh/scripts/diskfree.sh b/noncore/tools/opie-sh/scripts/diskfree.sh new file mode 100755 index 0000000..6fcd709 --- a/dev/null +++ b/noncore/tools/opie-sh/scripts/diskfree.sh | |||
@@ -0,0 +1,44 @@ | |||
1 | #!/bin/sh | ||
2 | |||
3 | # diskfree.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-5 - bugfix | ||
18 | # 20020524-1 - initial release | ||
19 | |||
20 | OPIE_SH=/opt/QtPalmtop/bin/opie-sh | ||
21 | |||
22 | # there must be a better way to do this with sed, but i had no time | ||
23 | # time to look into this yet... | ||
24 | |||
25 | ( echo "<img src=/opt/QtPalmtop/pics/opie-sh-scripts/fsmounter.png>" | ||
26 | echo "<h3>diskfree</h3> how much space is left ?<br>" | ||
27 | echo "<p><table>" | ||
28 | |||
29 | df -Ph \ | ||
30 | | grep -v "Mounted on" \ | ||
31 | | sed 's/ / /g' \ | ||
32 | | sed 's/ / /g' \ | ||
33 | | sed 's/ / /g' \ | ||
34 | | sed 's/ / /g' \ | ||
35 | | sed 's/ / /g' \ | ||
36 | | sed 's/ / /g' \ | ||
37 | | sed "s/ / /g" \ | ||
38 | | cut -d " " -f4- \ | ||
39 | | sed 's/ /<\/td><td>/g' \ | ||
40 | | sed 's/$/<\/td><\/tr>/' \ | ||
41 | | sed 's/^/<tr><td>/' ; echo "</table>" \ | ||
42 | ) | $OPIE_SH -t "Space left" -f | ||
43 | |||
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 new file mode 100755 index 0000000..faaf37c --- a/dev/null +++ b/noncore/tools/opie-sh/scripts/filesystem_mounter.sh | |||
@@ -0,0 +1,126 @@ | |||
1 | #!/bin/sh | ||
2 | |||
3 | # filesystem_mounter.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-2 - using df from diskfree now | ||
18 | # 20020524-1 - just code optix | ||
19 | # 20020519-1 - added information screen with manpage excerpt, added | ||
20 | # better returncode-checking | ||
21 | # 20020517-2 - fixed output bug | ||
22 | # 20020517-1 - nicer fullscreen, added about, tried icon | ||
23 | # | ||
24 | |||
25 | OPIE_SH=/opt/QtPalmtop/bin/opie-sh | ||
26 | |||
27 | ###################################################################### | ||
28 | # subroutines | ||
29 | |||
30 | about() { | ||
31 | ( echo "<img src=/opt/QtPalmtop/pics/opie-sh-scripts/fsmounter.png>" | ||
32 | echo "<h3>About</h3>" | ||
33 | echo "This little App should make it possible for you to " | ||
34 | echo "easily mount and unmount filesystems from /etc/fstab" | ||
35 | echo "<p>" | ||
36 | ) | $OPIE_SH -t fsmounter -f & | ||
37 | SCREENCLEAN=$! | ||
38 | sleep 1 | ||
39 | } | ||
40 | |||
41 | beforemount() { | ||
42 | ( echo "<img src=/opt/QtPalmtop/pics/opie-sh-scripts/fsmounter.png>" | ||
43 | echo "<h3>mount or unmount $MOUNTPOINT ?</h3>" | ||
44 | echo "<b>excerpt from MOUNT(8) manpage:</b><p>" | ||
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 | ||
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 | ||
49 | the big file tree. Conversely, the <b>umount(8)</b> command will | ||
50 | detach it again." | ||
51 | echo "<p>" | ||
52 | ) | $OPIE_SH -t fsmounter -f & | ||
53 | SCREENCLEAN2=$! | ||
54 | sleep 1 | ||
55 | } | ||
56 | |||
57 | |||
58 | cleanup() { | ||
59 | kill $SCREENCLEAN $SCREENCLEAN2 | ||
60 | rm -f /tmp/qcop-msg-filesystem_mounter.sh | ||
61 | } | ||
62 | |||
63 | get_action() { | ||
64 | # ask what to do (start/stop/status) | ||
65 | # | ||
66 | $OPIE_SH -m -t "Select Action" \ | ||
67 | -M "action for $MOUNTPOINT ?" \ | ||
68 | -g -0 mount -1 umount | ||
69 | RETURNCODE=$? | ||
70 | |||
71 | case $RETURNCODE in | ||
72 | -1|255) echo unexpected input detected, exiting. | $OPIE_SH -f | ||
73 | cleanup ;; | ||
74 | 0) ACTION=mount ;; | ||
75 | 1) ACTION=umount ;; | ||
76 | esac | ||
77 | kill $SCREENCLEAN2 | ||
78 | } | ||
79 | |||
80 | select_mountpoint() { | ||
81 | # present service list and choose | ||
82 | # | ||
83 | MOUNTPOINT=` cat /etc/fstab | cut -f1 \ | ||
84 | | cut -d " " -f1 \ | ||
85 | | egrep -v "(tmpfs|proc|devpts|^#)" \ | ||
86 | | $OPIE_SH -i -l \ | ||
87 | -g -t "SELECT MOUNTPOINT" \ | ||
88 | -L "select fs: " ` | ||
89 | } | ||
90 | |||
91 | ###################################################################### | ||
92 | # main | ||
93 | |||
94 | about | ||
95 | select_mountpoint | ||
96 | beforemount | ||
97 | get_action | ||
98 | |||
99 | if [ "$MOUNTPOINT" = "" ] | ||
100 | then echo "ugly error...." | $OPIE_SH -f ; cleanup | ||
101 | fi | ||
102 | |||
103 | ( echo "<img src=/opt/QtPalmtop/pics/opie-sh-scripts/fsmounter.png>" | ||
104 | echo "<h3>Output of $ACTION $MOUNTPOINT :</h3>" | ||
105 | echo "<pre>" | ||
106 | $ACTION $MOUNTPOINT 2>&1 | ||
107 | echo "</pre><p>" | ||
108 | echo "<h3>diskfree</h3> how much space is left ?<br>" | ||
109 | echo "<p><table>" | ||
110 | |||
111 | df -Ph \ | ||
112 | | grep -v "Mounted on" \ | ||
113 | | sed 's/ / /g' \ | ||
114 | | sed 's/ / /g' \ | ||
115 | | sed 's/ / /g' \ | ||
116 | | sed 's/ / /g' \ | ||
117 | | sed 's/ / /g' \ | ||
118 | | sed 's/ / /g' \ | ||
119 | | sed "s/ / /g" \ | ||
120 | | cut -d " " -f4- \ | ||
121 | | sed 's/ /<\/td><td>/g' \ | ||
122 | | sed 's/$/<\/td><\/tr>/' \ | ||
123 | | sed 's/^/<tr><td>/' ; echo "</table>" \ | ||
124 | ) | $OPIE_SH -f | ||
125 | |||
126 | cleanup | ||
diff --git a/noncore/tools/opie-sh/scripts/hostlist.sh b/noncore/tools/opie-sh/scripts/hostlist.sh new file mode 100755 index 0000000..6575e9c --- a/dev/null +++ b/noncore/tools/opie-sh/scripts/hostlist.sh | |||
@@ -0,0 +1,80 @@ | |||
1 | #!/bin/sh | ||
2 | |||
3 | # hostlist.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 - icon to hostlist | ||
18 | # 20020517-1 - added icon, changed name in launcher | ||
19 | # | ||
20 | |||
21 | CFG=/opt/QtPalmtop/share/config/hostlist.cfg | ||
22 | OPIE_SH=opie-sh | ||
23 | |||
24 | hostlist() { | ||
25 | (echo "<img src=/opt/QtPalmtop/pics/opie-sh-scripts/hostlist.png>" | ||
26 | echo "<h3>Hostlist</h3><br>" | ||
27 | HOSTLIST=`cat $CFG` | ||
28 | for HOST in $HOSTLIST | ||
29 | do | ||
30 | PT=` ping -c1 $HOST | grep avg|cut -d " " -f4-` | ||
31 | if [ "$PT" != "" ] | ||
32 | then echo "<b><font color=#00ff00> " | ||
33 | echo "$HOST is up<br></font></b>[$PT]<br>" | ||
34 | else echo "<b><font color=#ff0000> " | ||
35 | echo "$HOST is down<br></font></b>[$PT]<br>" | ||
36 | fi | ||
37 | done | ||
38 | ) | $OPIE_SH -t "Which are up ?" -f | ||
39 | |||
40 | |||
41 | } | ||
42 | |||
43 | cleanup() { | ||
44 | kill $SCREENCLEAN | ||
45 | rm -f /tmp/qcop-msg-hostlist.sh | ||
46 | } | ||
47 | |||
48 | about() { | ||
49 | ( echo "<img src=/opt/QtPalmtop/pics/opie-sh-scripts/hostlist.png>" | ||
50 | echo "<h3>About</h3>" | ||
51 | echo "This little App should make it possible for you to " | ||
52 | echo "check some hosts for availability." | ||
53 | echo "<p>" | ||
54 | ) | $OPIE_SH -t hostlist -f & | ||
55 | SCREENCLEAN=$! | ||
56 | sleep 1 | ||
57 | } | ||
58 | |||
59 | ##################################################################### | ||
60 | # | ||
61 | # main | ||
62 | |||
63 | about | ||
64 | |||
65 | # ask to: start or edit list | ||
66 | $OPIE_SH -m -g -t Hostlist -M "Welcome!" -0 Start -1 "Edit Hostlist" | ||
67 | RETURNCODE=$? | ||
68 | case $RETURNCODE in | ||
69 | -1)echo died unexpectedly... | $OPIE_SH -f | ||
70 | cleanup | ||
71 | exit ;; | ||
72 | 1) textedit $CFG | ||
73 | cleanup ;; | ||
74 | 0)if [ -f $CFG ] | ||
75 | thenhostlist | ||
76 | else echo www,handhelds.org >$CFG ; hostlist | ||
77 | fi | ||
78 | cleanup | ||
79 | ;; | ||
80 | esac | ||
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 | |||
21 | OPIE_SH=/opt/QtPalmtop/bin/opie-sh | ||
22 | |||
23 | ###################################################################### | ||
24 | # subroutines | ||
25 | |||
26 | about() { | ||
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 | |||
39 | cleanup() { | ||
40 | kill $SCREENCLEAN | ||
41 | rm -f /tmp/qcop-msg-killproc.sh | ||
42 | } | ||
43 | |||
44 | select_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 | |||
57 | about | ||
58 | select_process | ||
59 | |||
60 | PROCESS=`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 | |||
71 | cleanup | ||
diff --git a/noncore/tools/opie-sh/scripts/launcher_refresh.sh b/noncore/tools/opie-sh/scripts/launcher_refresh.sh new file mode 100755 index 0000000..7850508 --- a/dev/null +++ b/noncore/tools/opie-sh/scripts/launcher_refresh.sh | |||
@@ -0,0 +1,44 @@ | |||
1 | #!/bin/sh | ||
2 | |||
3 | # launcher_refresh.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 | OPIE_SH=opie-sh | ||
18 | |||
19 | launcher_refresh() { | ||
20 | (echo "<img src=/opt/QtPalmtop/pics/opie-sh-scripts/launcher_refresh.png>" | ||
21 | echo "<h3>Refresh successful!</h3><br>" | ||
22 | echo the launcher has been refreshed. | ||
23 | echo | ||
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 | ||
26 | echo often. | ||
27 | echo "<p>" it also refreshes the input-methods. | ||
28 | ) | $OPIE_SH -t "launcher-refresh" -f | ||
29 | } | ||
30 | |||
31 | cleanup() { | ||
32 | rm -f /tmp/qcop-msg-launcher_refresh.sh | ||
33 | } | ||
34 | |||
35 | ##################################################################### | ||
36 | # | ||
37 | # main | ||
38 | |||
39 | /opt/QtPalmtop/bin/qcop QPE/TaskBar "reloadInputMethods()" | ||
40 | #/opt/QtPalmtop/bin/qcop QPE/System "restart()" | ||
41 | /opt/QtPalmtop/bin/qcop QPE/System "linkChanged(QString)" | ||
42 | |||
43 | launcher_refresh | ||
44 | cleanup | ||
diff --git a/noncore/tools/opie-sh/scripts/logviewer.sh b/noncore/tools/opie-sh/scripts/logviewer.sh new file mode 100755 index 0000000..e9657b4 --- a/dev/null +++ b/noncore/tools/opie-sh/scripts/logviewer.sh | |||
@@ -0,0 +1,116 @@ | |||
1 | #!/bin/sh | ||
2 | |||
3 | # logviewer.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 | # 20020526-1a - initial release... | ||
18 | # | ||
19 | |||
20 | OPIE_SH=/opt/QtPalmtop/bin/opie-sh | ||
21 | INITPATH=/etc/init.d | ||
22 | |||
23 | ###################################################################### | ||
24 | # subroutines | ||
25 | |||
26 | about() { | ||
27 | ( echo "<img src=/opt/QtPalmtop/pics/opie-sh-scripts/logviewer.png>" | ||
28 | echo "<h3>About</h3>" | ||
29 | echo "This little App should make it possible for you to " | ||
30 | echo "easily have a look at some of the syslogs. " | ||
31 | echo "<p>" | ||
32 | ) | $OPIE_SH -t logviewer -f & | ||
33 | SCREENCLEAN=$! | ||
34 | sleep 1 | ||
35 | } | ||
36 | |||
37 | cleanup() { | ||
38 | kill $SCREENCLEAN 2>/dev/null | ||
39 | rm -f /tmp/qcop-msg-logviewer.sh | ||
40 | } | ||
41 | |||
42 | choose_log() { | ||
43 | # ask what to do (start/stop/status) | ||
44 | # | ||
45 | $OPIE_SH -m -t "Select Log" \ | ||
46 | -M "which logfile are you interested in ?<br>" \ | ||
47 | -g -0 "PROC" -1 "SYSLOG" | ||
48 | RETURNCODE=$? | ||
49 | |||
50 | case $RETURNCODE in | ||
51 | -1) echo unexpected input detected, exiting. | ||
52 | cleanup ;; | ||
53 | 0) LOGMETHOD=proc ;; | ||
54 | 1) LOGMETHOD=syslog ;; | ||
55 | esac | ||
56 | } | ||
57 | |||
58 | ###################################################################### | ||
59 | # main | ||
60 | |||
61 | about | ||
62 | choose_log | ||
63 | |||
64 | case $LOGMETHOD in | ||
65 | proc) $OPIE_SH -m -t "Select Log" \ | ||
66 | -M "which procfile ?<br>" \ | ||
67 | -g -0 kmsg -1 "ksyms" | ||
68 | RETURNCODE=$? | ||
69 | case $RETURNCODE in | ||
70 | -1) cleanup ;; | ||
71 | 0) | ||
72 | |||
73 | cat /proc/kmsg >/tmp/log.$$ & | ||
74 | PID=$! | ||
75 | sleep 2 | ||
76 | kill $PID | ||
77 | ( echo "<img src=/opt/QtPalmtop/pics/opie-sh-scripts/logviewer.png>" | ||
78 | echo "<h3>/proc/kmsg</h3>" | ||
79 | cat /tmp/log.$$ | ||
80 | ) | $OPIE_SH -t kmsg -f | ||
81 | rm -f /tmp/$$ | ||
82 | cleanup ;; | ||
83 | |||
84 | 1) | ||
85 | |||
86 | cat /proc/ksyms >/tmp/log.$$ & | ||
87 | PID=$! | ||
88 | sleep 2 | ||
89 | kill $PID | ||
90 | ( echo "<img src=/opt/QtPalmtop/pics/opie-sh-scripts/logviewer.png>" | ||
91 | echo "<h3>/proc/ksyms</h3>" | ||
92 | cat /tmp/log.$$ | ||
93 | ) | $OPIE_SH -t ksyms -f | ||
94 | rm -f /tmp/$$ | ||
95 | cleanup ;; | ||
96 | |||
97 | *) cleanup ;; | ||
98 | esac | ||
99 | cleanup ;; | ||
100 | |||
101 | syslog) | ||
102 | |||
103 | if [ -f /var/log/messages ] | ||
104 | then | ||
105 | $OPIE_SH -t syslog -f /var/log/messages | ||
106 | else | ||
107 | echo "no syslogd installed or /var/log/messages inexistent." \ | ||
108 | | $OPIE_SH -t syslog -f | ||
109 | fi | ||
110 | ;; | ||
111 | *) cleanup ;; | ||
112 | esac | ||
113 | |||
114 | |||
115 | cleanup | ||
116 | |||
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 | |||
22 | OPIE_SH=opie-sh | ||
23 | |||
24 | about() { | ||
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 | |||
38 | cleanup() { | ||
39 | kill $SCREENCLEAN $SCREENCLEAN2 | ||
40 | rm -f /tmp/qcop-msg-opie-sh-wavelanchooser.sh | ||
41 | } | ||
42 | |||
43 | |||
44 | about | ||
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 | |||
51 | if [ "$?" = "0" ] | ||
52 | thenDECISION=home | ||
53 | elseDECISION=work | ||
54 | fi | ||
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 | |||
62 | cleanup | ||
diff --git a/noncore/tools/opie-sh/scripts/rsyncme.sh b/noncore/tools/opie-sh/scripts/rsyncme.sh new file mode 100755 index 0000000..c09aea8 --- a/dev/null +++ b/noncore/tools/opie-sh/scripts/rsyncme.sh | |||
@@ -0,0 +1,109 @@ | |||
1 | #!/bin/sh | ||
2 | |||
3 | # rsyncme.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 | # 20020517-1 - added icon, changed name in launcher | ||
18 | # | ||
19 | |||
20 | CFG=/opt/QtPalmtop/share/config/rsyncme.cfg | ||
21 | OPIE_SH=opie-sh | ||
22 | |||
23 | update_cfg() { | ||
24 | # check if dir is in CFG and if not add it | ||
25 | if [ "`grep -c $DIR $CFG`" = "0" ] | ||
26 | thenecho $DIR >>$CFG | ||
27 | fi | ||
28 | } | ||
29 | |||
30 | ask_dirs() { | ||
31 | # get source and destination dir | ||
32 | DIR=`$OPIE_SH -g -i -t "Choose Source Directory" -l -L DIR: -E -F $CFG ` | ||
33 | update_cfg | ||
34 | SRCDIR=$DIR | ||
35 | |||
36 | DIR=`$OPIE_SH -g -i -t "Choose Destination Directory" -l -L DIR: -E -F $CFG ` | ||
37 | update_cfg | ||
38 | DESTDIR=$DIR | ||
39 | } | ||
40 | |||
41 | ask_options() { | ||
42 | # now ask for options | ||
43 | OPTIONS="--archive --verbose --checksum --recursive --update --links --partial --dry-run --rsh=ssh --existing --compress --recursive" | ||
44 | OUTPUT=`( for OPTION in $OPTIONS | ||
45 | do | ||
46 | echo "$OPTION" | ||
47 | done ) | $OPIE_SH -t "Select options" -g -i -b -F ` | ||
48 | } | ||
49 | |||
50 | rsync_output() { | ||
51 | ( echo "<h3>Output of your rsync:</h3>" | ||
52 | echo "command: rsync $OUTPUT $SRCDIR $DESTDIR" | ||
53 | echo "<pre>" | ||
54 | rsync $OUTPUT $SRCDIR $DESTDIR 2>&1 | ||
55 | echo "</pre>done." | ||
56 | ) | $OPIE_SH -t "Result:" -f | ||
57 | } | ||
58 | |||
59 | cleanup() { | ||
60 | kill $SCREENCLEAN | ||
61 | rm -f /tmp/qcop-msg-rsyncme.sh | ||
62 | } | ||
63 | |||
64 | show_dirs() { | ||
65 | ( echo "<h3>Directorys chosen for sync:</h3>" | ||
66 | echo "<ul><li>$SRCDIR<li>$DESTDIR</ul>" ) \ | ||
67 | | $OPIE_SH -t "Got directories" -f | ||
68 | } | ||
69 | |||
70 | about() { | ||
71 | ( echo "<img src=/opt/QtPalmtop/pics/opie-sh-scripts/rsyncme.png>" | ||
72 | echo "<h3>About</h3>" | ||
73 | echo "This little App should make it possible for you to " | ||
74 | echo "easily choose the wanted options for an rsync process." | ||
75 | echo "<p>" | ||
76 | ) | $OPIE_SH -t rsync-helper -f & | ||
77 | SCREENCLEAN=$! | ||
78 | sleep 1 | ||
79 | } | ||
80 | |||
81 | |||
82 | |||
83 | |||
84 | ##################################################################### | ||
85 | # | ||
86 | # main | ||
87 | |||
88 | about | ||
89 | |||
90 | # ask to: start rsync, edit dirlist, show about | ||
91 | $OPIE_SH -m -g -t RsyncMe -M "Welcome!" -0 Start -1 Dirlist | ||
92 | RETURNCODE=$? | ||
93 | case $RETURNCODE in | ||
94 | -1)echo died unexpectedly... | $OPIE_SH -f | ||
95 | cleanup | ||
96 | exit ;; | ||
97 | 1) textedit $CFG | ||
98 | cleanup ;; | ||
99 | 0)if [ -f $CFG ] | ||
100 | thenask_dirs | ||
101 | show_dirs | ||
102 | ask_options | ||
103 | rsync_output | ||
104 | else ( echo no config file seems to exist - see About... ) \ | ||
105 | | $OPIE_SH -t "SORRY..." -f | ||
106 | fi | ||
107 | cleanup | ||
108 | ;; | ||
109 | esac | ||
diff --git a/noncore/tools/opie-sh/scripts/service_manager.sh b/noncore/tools/opie-sh/scripts/service_manager.sh new file mode 100755 index 0000000..d1423a5 --- a/dev/null +++ b/noncore/tools/opie-sh/scripts/service_manager.sh | |||
@@ -0,0 +1,110 @@ | |||
1 | #!/bin/sh | ||
2 | |||
3 | # service_manager.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 - added icon to statusinfo... | ||
18 | # 20020518-1 - optix | ||
19 | # 20020517-1 - added about and fullscreen | ||
20 | # | ||
21 | |||
22 | OPIE_SH=/opt/QtPalmtop/bin/opie-sh | ||
23 | INITPATH=/etc/init.d | ||
24 | |||
25 | ###################################################################### | ||
26 | # subroutines | ||
27 | |||
28 | about() { | ||
29 | ( echo "<img src=/opt/QtPalmtop/pics/opie-sh-scripts/service_manager.png>" | ||
30 | echo "<h3>About</h3>" | ||
31 | echo "This little App should make it possible for you to " | ||
32 | echo "easily start and stop services in /etc/init.d." | ||
33 | echo "<p>" | ||
34 | ) | $OPIE_SH -t service-manager -f & | ||
35 | SCREENCLEAN=$! | ||
36 | sleep 1 | ||
37 | } | ||
38 | |||
39 | cleanup() { | ||
40 | kill $SCREENCLEAN | ||
41 | rm -f /tmp/qcop-msg-service_manager.sh | ||
42 | } | ||
43 | |||
44 | get_action() { | ||
45 | # ask what to do (start/stop/status) | ||
46 | # | ||
47 | $OPIE_SH -m -t "Select Action" \ | ||
48 | -M "which action do you want to do to $SERVICE ?<br>" \ | ||
49 | -g -0 start -1 stop -2 status | ||
50 | RETURNCODE=$? | ||
51 | |||
52 | case $RETURNCODE in | ||
53 | -1) echo unexpected input detected, exiting. | ||
54 | exit ;; | ||
55 | 0) ACTION=start ;; | ||
56 | 1) ACTION=stop ;; | ||
57 | 2) ACTION=status ;; | ||
58 | esac | ||
59 | } | ||
60 | |||
61 | status_disclaimer() { | ||
62 | # tell that init scripts are not too standard | ||
63 | # | ||
64 | cat | $OPIE_SH -f <<EOT | ||
65 | <img src=/opt/QtPalmtop/pics/opie-sh-scripts/service_manager.png> | ||
66 | <h3>status has been disabled</h3> | ||
67 | |||
68 | the status service has been disabled | ||
69 | because it is not supported by the | ||
70 | most init scripts that come with | ||
71 | familiar ...<p> | ||
72 | |||
73 | perhaps it will be replaced with | ||
74 | something more useful in the future... | ||
75 | EOT | ||
76 | } | ||
77 | |||
78 | select_service() { | ||
79 | # present service list and choose | ||
80 | # | ||
81 | cd $INITPATH/ | ||
82 | SERVICE=` ls -1 | $OPIE_SH -i -l \ | ||
83 | -g -t "Select Service" \ | ||
84 | ` | ||
85 | cd - | ||
86 | } | ||
87 | |||
88 | ###################################################################### | ||
89 | # main | ||
90 | |||
91 | about | ||
92 | select_service | ||
93 | get_action | ||
94 | |||
95 | if [ "$SERVICE" = "" ] | ||
96 | then cleanup ; exit | ||
97 | fi | ||
98 | |||
99 | if [ "$ACTION" = "status" ] | ||
100 | then status_disclaimer | ||
101 | else ( echo "<h3>Output of $INITPATH/$SERVICE $ACTION:</h3>" | ||
102 | echo "<pre>" | ||
103 | $INITPATH/$SERVICE $ACTION | ||
104 | echo "</pre><p>" | ||
105 | echo done. | ||
106 | ) | $OPIE_SH -f | ||
107 | fi | ||
108 | |||
109 | cleanup | ||
110 | |||
diff --git a/noncore/tools/opie-sh/scripts/usbnetctrl.sh b/noncore/tools/opie-sh/scripts/usbnetctrl.sh new file mode 100755 index 0000000..a12f74b --- a/dev/null +++ b/noncore/tools/opie-sh/scripts/usbnetctrl.sh | |||
@@ -0,0 +1,90 @@ | |||
1 | #!/bin/sh | ||
2 | |||
3 | # usbnetctrl.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 beautification, added icons and reset | ||
18 | # 20020517-2 - bugfixed fullscreen, added info about ifconfig | ||
19 | # 20020517-1 - added about, fullscreen and icon | ||
20 | |||
21 | OPIE_SH=/opt/QtPalmtop/bin/opie-sh | ||
22 | |||
23 | ###################################################################### | ||
24 | # subroutines | ||
25 | |||
26 | about() { | ||
27 | ( echo "<img src=/opt/QtPalmtop/pics/opie-sh-scripts/usbnetctrl.png>" | ||
28 | echo "<h3>About</h3>" | ||
29 | echo "This little App should make it easy for you to " | ||
30 | echo "activate / deactivate the usbnet-driver (on ipaq)" | ||
31 | echo "<p>" | ||
32 | echo "To use it at first, you need to change the ifconfig" | ||
33 | echo "line in /opt/QtPalmtop/bin/usbnetctrl.sh." | ||
34 | ) | $OPIE_SH -t "usbnet control" -f & | ||
35 | SCREENCLEAN=$! | ||
36 | sleep 1 | ||
37 | } | ||
38 | |||
39 | startup() { | ||
40 | ( echo "<img src=/opt/QtPalmtop/pics/opie-sh-scripts/usbnetctrl.png>" | ||
41 | echo "<h3>usbnet up</h3>" | ||
42 | modprobe usb-eth | ||
43 | |||
44 | ifconfig usbf 10.3.0.226 netmask 255.255.255.0 \ | ||
45 | broadcast 10.3.0.255 | ||
46 | |||
47 | ) 2>&1 | $OPIE_SH -t Output -f | ||
48 | if [ -f /root/masq.sh ] | ||
49 | then sh /root/masq.sh | ||
50 | fi | ||
51 | } | ||
52 | |||
53 | stopit() { | ||
54 | ( echo "<img src=/opt/QtPalmtop/pics/opie-sh-scripts/usbnetctrl.png>" | ||
55 | echo "<h3>usbnet down</h3>" | ||
56 | ifconfig usbf down | ||
57 | sleep 1 | ||
58 | rmmod usb-eth | ||
59 | rmmod sa1100usb_core | ||
60 | ) 2>&1 | $OPIE_SH -t Output -f | ||
61 | } | ||
62 | |||
63 | |||
64 | cleanup() { | ||
65 | kill $SCREENCLEAN | ||
66 | rm -f /tmp/qcop-msg-usbnetctrl.sh | ||
67 | } | ||
68 | |||
69 | |||
70 | yesorno() { | ||
71 | $OPIE_SH -m -t "USB-Net start/stop" -M "What to do with usbnet: " \ | ||
72 | -g -0 Start -1 Stop -2 Restart | ||
73 | RETURNCODE=$? | ||
74 | |||
75 | case $RETURNCODE in | ||
76 | -1) echo error... | ||
77 | cleanup | ||
78 | exit ;; | ||
79 | 0) startup ;; | ||
80 | 1) stopit ;; | ||
81 | 2) stopit ; sleep 1 ; startup ;; | ||
82 | esac | ||
83 | } | ||
84 | |||
85 | ###################################################################### | ||
86 | # main | ||
87 | |||
88 | about | ||
89 | yesorno | ||
90 | cleanup | ||
diff --git a/pics/opie-sh-scripts/diskfree.png b/pics/opie-sh-scripts/diskfree.png new file mode 100644 index 0000000..8628710 --- a/dev/null +++ b/pics/opie-sh-scripts/diskfree.png | |||
Binary files differ | |||
diff --git a/pics/opie-sh-scripts/fsmounter.png b/pics/opie-sh-scripts/fsmounter.png new file mode 100644 index 0000000..c22f304 --- a/dev/null +++ b/pics/opie-sh-scripts/fsmounter.png | |||
Binary files differ | |||
diff --git a/pics/opie-sh-scripts/hostlist.png b/pics/opie-sh-scripts/hostlist.png new file mode 100644 index 0000000..e722d1a --- a/dev/null +++ b/pics/opie-sh-scripts/hostlist.png | |||
Binary files differ | |||
diff --git a/pics/opie-sh-scripts/killproc.png b/pics/opie-sh-scripts/killproc.png new file mode 100755 index 0000000..efb950c --- a/dev/null +++ b/pics/opie-sh-scripts/killproc.png | |||
Binary files differ | |||
diff --git a/pics/opie-sh-scripts/launcher_refresh.png b/pics/opie-sh-scripts/launcher_refresh.png new file mode 100644 index 0000000..0960e94 --- a/dev/null +++ b/pics/opie-sh-scripts/launcher_refresh.png | |||
Binary files differ | |||
diff --git a/pics/opie-sh-scripts/logviewer.png b/pics/opie-sh-scripts/logviewer.png new file mode 100644 index 0000000..d232213 --- a/dev/null +++ b/pics/opie-sh-scripts/logviewer.png | |||
Binary files differ | |||
diff --git a/pics/opie-sh-scripts/qtwavelan.png b/pics/opie-sh-scripts/qtwavelan.png new file mode 100644 index 0000000..1687437 --- a/dev/null +++ b/pics/opie-sh-scripts/qtwavelan.png | |||
Binary files differ | |||
diff --git a/pics/opie-sh-scripts/rsyncme.png b/pics/opie-sh-scripts/rsyncme.png new file mode 100644 index 0000000..862b143 --- a/dev/null +++ b/pics/opie-sh-scripts/rsyncme.png | |||
Binary files differ | |||
diff --git a/pics/opie-sh-scripts/service_manager.png b/pics/opie-sh-scripts/service_manager.png new file mode 100644 index 0000000..b4b3884 --- a/dev/null +++ b/pics/opie-sh-scripts/service_manager.png | |||
Binary files differ | |||
diff --git a/pics/opie-sh-scripts/usbnetctrl.png b/pics/opie-sh-scripts/usbnetctrl.png new file mode 100644 index 0000000..6227d9e --- a/dev/null +++ b/pics/opie-sh-scripts/usbnetctrl.png | |||
Binary files differ | |||
diff --git a/share/config/hostlist.cfg b/share/config/hostlist.cfg new file mode 100644 index 0000000..7ee0f9c --- a/dev/null +++ b/share/config/hostlist.cfg | |||
@@ -0,0 +1,2 @@ | |||
1 | www.handhelds.org | ||
2 | www.unknownhostwhichisneverup.dk | ||
diff --git a/share/config/rsyncme.cfg b/share/config/rsyncme.cfg new file mode 100644 index 0000000..2de9b77 --- a/dev/null +++ b/share/config/rsyncme.cfg | |||
@@ -0,0 +1,6 @@ | |||
1 | /tmp/ | ||
2 | /tmp/root/ | ||
3 | /root/ | ||
4 | /mnt/nfs/root/ | ||
5 | 10.2.0.222:/root/ | ||
6 | |||