projects
/
matthijs
/
upstream
/
backupninja-vserver.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
r3567@krups: intrigeri | 2005-11-17 22:08:30 +0100
[matthijs/upstream/backupninja-vserver.git]
/
handlers
/
dup.helper
diff --git
a/handlers/dup.helper
b/handlers/dup.helper
index 89f458da03157c6a265c3bd44d50c471a88e6ce1..7eca26195955e36088132a89973fb6c2620753ce 100644
(file)
--- a/
handlers/dup.helper
+++ b/
handlers/dup.helper
@@
-22,10
+22,9
@@
do_dup_host_includes() {
}
do_dup_vserver() {
}
do_dup_vserver() {
- # choose the vservers to backup
-
vservers_chooser
"$dup_title"
+ # choose the vservers to backup
(into $selected_vservers)
+
choose_one_or_more_vservers
"$dup_title"
[ $? = 0 ] || return 1
[ $? = 0 ] || return 1
- dup_vsnames="$vservers_chooser_vsnames"
set -o noglob
# choose the files to backup
set -o noglob
# choose the files to backup
@@
-61,7
+60,7
@@
do_dup_excludes() {
}
do_dup_src() {
}
do_dup_src() {
-
host_or_vservers_chooser
"$dup_title"
+
choose_host_or_vservers_or_both
"$dup_title"
[ $? = 0 ] || return 1
case $host_or_vservers in
'host')
[ $? = 0 ] || return 1
case $host_or_vservers in
'host')
@@
-159,9
+158,12
@@
do_dup_gpg() {
set +o noglob
_gpg_done="(DONE)"
set +o noglob
_gpg_done="(DONE)"
- setDefault conn
+ setDefault adv
+ # TODO: replace the above line by the following when do_dup_conn is written
+ # setDefault conn
}
}
+# TODO: share rdiff.helper code in some lib, and use it here
do_dup_conn() {
_con_done="(DONE)"
setDefault adv
do_dup_conn() {
_con_done="(DONE)"
setDefault adv
@@
-256,7
+258,7
@@
encryptkey = $dup_gpg_encryptkey
# include = /mnt/crypt/home/user/Mail
EOF
# include = /mnt/crypt/home/user/Mail
EOF
- if [ "$host_or_vservers" ==
'host' -o "$host_or_vservers" == 'both'
]; then
+ if [ "$host_or_vservers" ==
host -o "$host_or_vservers" == both
]; then
set -o noglob
for ((i=0; i < ${#dup_includes[@]} ; i++)); do
echo "include = ${dup_includes[$i]}" >> $next_filename
set -o noglob
for ((i=0; i < ${#dup_includes[@]} ; i++)); do
echo "include = ${dup_includes[$i]}" >> $next_filename
@@
-280,9
+282,9
@@
EOF
EOF
EOF
- if [ "$host_or_vservers" ==
'vservers' -o "$host_or_vservers" == 'both'
]; then
+ if [ "$host_or_vservers" ==
vservers -o "$host_or_vservers" == both
]; then
set -o noglob
set -o noglob
- echo
"vsnames = \"$dup_vsname
s\"\n" >> $next_filename
+ echo
-e "vsnames = \"$selected_vserver
s\"\n" >> $next_filename
for ((i=0; i < ${#dup_vsincludes[@]} ; i++)); do
echo "vsinclude = ${dup_vsincludes[$i]}" >> $next_filename
done
for ((i=0; i < ${#dup_vsincludes[@]} ; i++)); do
echo "vsinclude = ${dup_vsincludes[$i]}" >> $next_filename
done
@@
-354,11
+356,12
@@
dup_main_menu() {
gpgitem="configure GnuPG encryption/signing $_gpg_done"
conitem="set up ssh keys and test remote connection $_con_done"
advitem="edit advanced settings $_adv_done"
gpgitem="configure GnuPG encryption/signing $_gpg_done"
conitem="set up ssh keys and test remote connection $_con_done"
advitem="edit advanced settings $_adv_done"
+ # TODO: add the following to the menu when do_dup_conn is written
+ # conn "$conitem" \
menuBox "$dup_title" "choose a step:" \
src "$srcitem" \
dest "$destitem" \
gpg "$gpgitem" \
menuBox "$dup_title" "choose a step:" \
src "$srcitem" \
dest "$destitem" \
gpg "$gpgitem" \
- conn "$conitem" \
adv "$advitem" \
finish "finish and create config file"
[ $? = 0 ] || return 1
adv "$advitem" \
finish "finish and create config file"
[ $? = 0 ] || return 1
@@
-368,10
+371,13
@@
dup_main_menu() {
"src") do_dup_src;;
"dest") do_dup_dest;;
"gpg") do_dup_gpg;;
"src") do_dup_src;;
"dest") do_dup_dest;;
"gpg") do_dup_gpg;;
- "conn") do_dup_conn;;
+ # TODO: enable the following when do_dup_conn is written
+ # "conn") do_dup_conn;;
"adv") do_dup_adv;;
"finish")
"adv") do_dup_adv;;
"finish")
- if [[ "$_con_done$_dest_done$_gpg_done$_src_done" != "(DONE)(DONE)(DONE)(DONE)" ]]; then
+ if [[ "$_dest_done$_gpg_done$_src_done" != "(DONE)(DONE)(DONE)" ]]; then
+ # TODO: replace the previous test by the following when do_dup_conn is written
+ # if [[ "$_con_done$_dest_done$_gpg_done$_src_done" != "(DONE)(DONE)(DONE)(DONE)" ]]; then
msgBox "$dup_title" "You cannot create the configuration file until the four first steps are completed."
else
do_dup_finish
msgBox "$dup_title" "You cannot create the configuration file until the four first steps are completed."
else
do_dup_finish
@@
-401,7
+407,6
@@
dup_wizard() {
declare -a dup_includes
declare -a dup_excludes
declare -a dup_vsincludes
declare -a dup_includes
declare -a dup_excludes
declare -a dup_vsincludes
- dup_vsnames=
dup_incremental=yes
dup_keep=60
dup_bandwidth=
dup_incremental=yes
dup_keep=60
dup_bandwidth=