X-Git-Url: https://git.stderr.nl/gitweb?a=blobdiff_plain;f=handlers%2Frdiff.helper;h=68ba8a2d49db1ea71ab70c9e3917f8f6ead65be5;hb=d5c8686efd9ea9a5c4f8bc8c3566c2e6a0165ace;hp=0bd982c3d415b3b6d79689c13e6f10c273936750;hpb=0e1bd269884c234dd76b00fa30bae674e82892bf;p=matthijs%2Fupstream%2Fbackupninja.git diff --git a/handlers/rdiff.helper b/handlers/rdiff.helper index 0bd982c..68ba8a2 100644 --- a/handlers/rdiff.helper +++ b/handlers/rdiff.helper @@ -11,7 +11,7 @@ do_rdiff_dest() { formItem "dest_host" "$rdiff_host" formItem "dest_user" "$rdiff_user" formDisplay - [ $? = 1 ] && return; + [ $? = 0 ] || return IFS=$'' replyconverted=`echo $REPLY | tr '\n' :` @@ -40,7 +40,7 @@ do_rdiff_src() { formItem include formItem include formDisplay - [ $? = 1 ] && return; + [ $? = 0 ] || return unset rdiff_includes rdiff_includes=($REPLY) @@ -52,7 +52,7 @@ do_rdiff_src() { formItem exclude formItem exclude formDisplay - [ $? = 1 ] && return; + [ $? = 0 ] || return unset rdiff_excludes rdiff_excludes=($REPLY) @@ -62,7 +62,7 @@ do_rdiff_src() { set +o noglob } -do_ssh_con() { +do_rdiff_ssh_con() { IFS=$' \t\n' if [ "$_dest_done" = "" ]; then msgBox "rdiff action wizard: error" "You must first configure the destination." @@ -75,7 +75,7 @@ do_ssh_con() { return else booleanBox "rdiff action wizard" "This step will create a ssh key for the local root user with no passphrase (if one does not already exist), and attempt to copy root's public ssh key to authorized_keys file of $rdiff_user@$rdiff_host. This will allow the local root to make unattended backups to $rdiff_user@$rdiff_host.\n\n\nAre you sure you want to continue?" - [ $? = 1 ] && return + [ $? = 0 ] || return fi if [ ! -f /root/.ssh/id_dsa.pub -a ! -f /root/.ssh/id_rsa.pub ]; then @@ -263,13 +263,13 @@ rdiff_main_menu() { dest "$destitem" \ conn "$conitem" \ finish "finish and create config file" - [ $? = 1 ] && return; + [ $? = 0 ] || return result="$REPLY" case "$result" in "src") do_rdiff_src;; "dest") do_rdiff_dest;; - "conn") do_ssh_con;; + "conn") do_rdiff_ssh_con;; "adv") do_rdiff_adv;; "finish") if [[ "$_con_done$_dest_done$_src_done" != "(DONE)(DONE)(DONE)" ]]; then @@ -294,8 +294,10 @@ rdiff_wizard() { rdiff_directory=/backup/`hostname` rdiff_user= rdiff_host= + set -o noglob rdiff_includes=(/var/spool/cron/crontabs /var/backups /etc /root /home /usr/local/*bin /var/lib/dpkg/status*) rdiff_excludes=(/home/*/.gnupg) + set +o noglob rdiff_main_menu }