X-Git-Url: https://git.stderr.nl/gitweb?a=blobdiff_plain;f=handlers%2Fdup.helper;h=7eca26195955e36088132a89973fb6c2620753ce;hb=d56c0f0aeedc84560821bd3c57239476e12615ca;hp=89f458da03157c6a265c3bd44d50c471a88e6ce1;hpb=9208b449da1a1df50c2759946c9931f456af1e87;p=matthijs%2Fupstream%2Fbackupninja.git diff --git a/handlers/dup.helper b/handlers/dup.helper index 89f458d..7eca261 100644 --- a/handlers/dup.helper +++ b/handlers/dup.helper @@ -22,10 +22,9 @@ do_dup_host_includes() { } 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 - dup_vsnames="$vservers_chooser_vsnames" set -o noglob # choose the files to backup @@ -61,7 +60,7 @@ do_dup_excludes() { } 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') @@ -159,9 +158,12 @@ do_dup_gpg() { 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 @@ -256,7 +258,7 @@ encryptkey = $dup_gpg_encryptkey # 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 @@ -280,9 +282,9 @@ 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 - echo "vsnames = \"$dup_vsnames\"\n" >> $next_filename + echo -e "vsnames = \"$selected_vservers\"\n" >> $next_filename 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" + # 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" \ - conn "$conitem" \ 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;; - "conn") do_dup_conn;; + # TODO: enable the following when do_dup_conn is written + # "conn") do_dup_conn;; "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 @@ -401,7 +407,6 @@ dup_wizard() { declare -a dup_includes declare -a dup_excludes declare -a dup_vsincludes - dup_vsnames= dup_incremental=yes dup_keep=60 dup_bandwidth=