1
1
Fork 1
mirror of https://github.com/nachoparker/btrfs-sync synced 2024-05-03 22:27:33 +02:00

exit if detection of remote src argument fails (#15)

This commit is contained in:
rababerladuseladim 2021-08-02 16:52:34 +02:00 committed by GitHub
parent 6d3c3f04b5
commit c4bdbf2117
Signed by: GitHub
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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