From c4bdbf21179843824774fe514338050a72db09c8 Mon Sep 17 00:00:00 2001 From: rababerladuseladim Date: Mon, 2 Aug 2021 16:52:34 +0200 Subject: [PATCH] exit if detection of remote src argument fails (#15) --- btrfs-sync | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/btrfs-sync b/btrfs-sync index 6c1d688..3179177 100644 --- a/btrfs-sync +++ b/btrfs-sync @@ -97,7 +97,7 @@ done SRC=( "${@:1:$#-1}" ) DST="${@: -1}" -# detect remote dst argument +# detect remote src argument [[ "$SRC" =~ : ]] && { NET_SRC="$( sed 's|:.*||' <<<"$SRC" )" SRC="$( sed 's|.*:||' <<<"$SRC" )" @@ -108,6 +108,7 @@ DST="${@: -1}" ${SRC_CMD[@]} test -x "$SRC" &>/dev/null || { [[ "$SSH_SRC" != "" ]] && echo "SSH access error to $NET_SRC. Do you have passwordless login setup, and adequate permissions for $SRC?" [[ "$SSH_SRC" == "" ]] && echo "Access error. Do you have adequate permissions for $SRC?" + exit 1 } # detect remote dst argument