summaryrefslogtreecommitdiff
path: root/noncore/tools/opie-sh/scripts/rsyncme.sh
Unidiff
Diffstat (limited to 'noncore/tools/opie-sh/scripts/rsyncme.sh') (more/less context) (ignore whitespace changes)
-rwxr-xr-xnoncore/tools/opie-sh/scripts/rsyncme.sh6
1 files changed, 3 insertions, 3 deletions
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,45 +1,45 @@
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
20CFG=/opt/QtPalmtop/share/config/rsyncme.cfg 20CFG=$OPIEDIR/share/config/rsyncme.cfg
21OPIE_SH=opie-sh 21OPIE_SH=$OPIEDIR/bin/opie-sh
22 22
23update_cfg() { 23update_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
30ask_dirs() { 30ask_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
41ask_options() { 41ask_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
@@ -47,49 +47,49 @@ ask_options() {
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
50rsync_output() { 50rsync_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
59cleanup() { 59cleanup() {
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
64show_dirs() { 64show_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
70about() { 70about() {
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
88about 88about
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
92RETURNCODE=$? 92RETURNCODE=$?
93case $RETURNCODE in 93case $RETURNCODE in
94 -1)echo died unexpectedly... | $OPIE_SH -f 94 -1)echo died unexpectedly... | $OPIE_SH -f
95 cleanup 95 cleanup