From 6e1d973f61642ec38a0a32a9e184ee9f3432a021 Mon Sep 17 00:00:00 2001 From: Thorsten Spille Date: Sat, 4 Mar 2023 22:05:53 +0100 Subject: [PATCH] Add log messages --- bashclub-zsync/usr/bin/bashclub-zsync | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/bashclub-zsync/usr/bin/bashclub-zsync b/bashclub-zsync/usr/bin/bashclub-zsync index 0344296..d2eed51 100644 --- a/bashclub-zsync/usr/bin/bashclub-zsync +++ b/bashclub-zsync/usr/bin/bashclub-zsync @@ -86,10 +86,10 @@ if [[ $source == "" ]]; then log "source is empty, switching to local mode." ssh= sshport= - log "Configuration:\n\ttarget=$target\n\ttag=$tag\n\tsubvol_source=$subvol_source\n\tsnapshot_filter=$snapshot_filter\n" + log "Configuration:\n\ttarget=$target\n\ttag=$tag\n\tsubvol_source=$subvol_source\n\tsnapshot_filter=$snapshot_filter\nmin_keep=$min_keep\n" else sshport=-p$sshport - log "Configuration:\n\ttarget=$target\n\tsource=$source\n\tsshport=$sshport\n\ttag=$tag\n\tsubvol_source=$subvol_source\n\tsnapshot_filter=$snapshot_filter\n" + log "Configuration:\n\ttarget=$target\n\tsource=$source\n\tsshport=$sshport\n\ttag=$tag\n\tsubvol_source=$subvol_source\n\tsnapshot_filter=$snapshot_filter\nmin_keep=$min_keep\n" fi @@ -98,11 +98,14 @@ remote_aes=$($ssh $source $sshport "/usr/bin/grep -m1 -o aes /proc/cpuinfo | uni if [[ $local_aes == "aes" ]] && [[ $remote_aes == "aes" ]]; then + if [[ $debug == "-v" ]]; then log "[DEBUG] Switching to cipher aes256-gcm@openssh.com"; fi sshcipher=-caes256-gcm@openssh.com +else + if [[ $debug == "-v" ]]; then log "[DEBUG] Using default cipher chacha20-poly1305@openssh.com"; fi + sshcipher=-cchacha20-poly1305@openssh.com fi -# query source datasets/subvols to replicate IFS=$'\n' for zvol in $($ssh $sshcipher $sshport $source "zfs get -H -o name,value,source -t filesystem,volume $tag"); do name=$(echo $zvol | cut -f1)