Some fixes for non woring sudo
This commit is contained in:
@@ -83,14 +83,18 @@ REMOTE_HOST="$2"
|
||||
DESTINATION_ROOT="${3%/}"
|
||||
SNAPSHOT_NAME="move-$(date +%Y%m%d-%H%M%S)"
|
||||
|
||||
[[ "$REMOTE_HOST" != *@ ]] || die "REMOTE_HOST is missing a hostname; use user@server-name or server-name"
|
||||
|
||||
command -v zfs >/dev/null || die "zfs command was not found"
|
||||
command -v zpool >/dev/null || die "zpool command was not found"
|
||||
command -v ssh >/dev/null || die "ssh command was not found"
|
||||
zpool list -H -o name "$SOURCE_POOL" >/dev/null || die "source pool does not exist: $SOURCE_POOL"
|
||||
|
||||
if ! $DRY_RUN; then
|
||||
ssh "${SSH_OPTIONS[@]}" "$REMOTE_HOST" true \
|
||||
|| die "cannot authenticate to $REMOTE_HOST with SSH keys or an SSH agent"
|
||||
ssh "${SSH_OPTIONS[@]}" "$REMOTE_HOST" 'sudo -n zfs list -H -o name -t filesystem >/dev/null' \
|
||||
|| die "cannot connect with non-interactive SSH or run 'sudo -n zfs' on $REMOTE_HOST"
|
||||
|| die "$REMOTE_HOST accepts SSH, but cannot run 'sudo -n zfs'; configure passwordless sudo for zfs"
|
||||
fi
|
||||
|
||||
map_destination() {
|
||||
|
||||
Reference in New Issue
Block a user