From 8da28b51a556b24e8060f2384a0938c35b3a2af9 Mon Sep 17 00:00:00 2001 From: "thorsten.spille" Date: Sat, 18 Feb 2023 11:27:41 +0100 Subject: [PATCH] =?UTF-8?q?=E2=80=9Ebashclub-zsync/usr/bin/bashclub-zsync?= =?UTF-8?q?=E2=80=9C=20=C3=A4ndern?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bashclub-zsync/usr/bin/bashclub-zsync | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/bashclub-zsync/usr/bin/bashclub-zsync b/bashclub-zsync/usr/bin/bashclub-zsync index 6c6c6c9..549e581 100644 --- a/bashclub-zsync/usr/bin/bashclub-zsync +++ b/bashclub-zsync/usr/bin/bashclub-zsync @@ -53,6 +53,7 @@ shift $((OPTIND-1)) # load config file if [ -f $conf ]; then + echo "Reading configuration $conf" source $conf else mkdir -p $(dirname $conf) @@ -67,6 +68,14 @@ EOF usage 0 fi +if [[ $source == "" ]]; then + echo "source is empty, switching to local mode." + ssh= + echo -e "Configuration:\n\ttarget=$target\n\ttag=$tag\n\tsubvol_source=$subvol_source\n\tsnapshot_filter=$snapshot_filter\n" +else + echo -e "Configuration:\n\ttarget=$target\n\tsource=$source\n\ttag=$tag\n\tsubvol_source=$subvol_source\n\tsnapshot_filter=$snapshot_filter\n" +fi + # query source datasets/subvols to replicate IFS=$'\n' for zvol in $($ssh $source "zfs get -H -o name,value,source -t filesystem,volume $tag"); do