]> git.proxmox.com Git - pve-zsync.git/commitdiff
fix another case where source-user was used to connect to dest
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Sat, 17 Nov 2018 14:35:24 +0000 (15:35 +0100)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Sat, 17 Nov 2018 14:35:24 +0000 (15:35 +0100)
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
pve-zsync

index 49fe473c606a0cf93fccd246b00cdc037e68d48e..b9a6995efdf76ecc556a0f9a2ef5836798054a9b 100755 (executable)
--- a/pve-zsync
+++ b/pve-zsync
@@ -887,10 +887,10 @@ sub snapshot_destroy {
 }
 
 sub snapshot_exist {
-    my ($source , $dest, $method, $source_user) = @_;
+    my ($source , $dest, $method, $dest_user) = @_;
 
     my $cmd = [];
-    push @$cmd, 'ssh', "$source_user\@$dest->{ip}", '--' if $dest->{ip};
+    push @$cmd, 'ssh', "$dest_user\@$dest->{ip}", '--' if $dest->{ip};
     push @$cmd, 'zfs', 'list', '-rt', 'snapshot', '-Ho', 'name';
 
     my $path = $dest->{all};
@@ -922,7 +922,7 @@ sub send_image {
     push @$cmd, 'zfs', 'send';
     push @$cmd, '-v' if $param->{verbose};
 
-    if($source->{last_snap} && snapshot_exist($source , $dest, $param->{method}, $param->{source_user})) {
+    if($source->{last_snap} && snapshot_exist($source , $dest, $param->{method}, $param->{dest_user})) {
        push @$cmd, '-i', "$source->{all}\@$source->{last_snap}";
     }
     push @$cmd, '--', "$source->{all}\@$source->{new_snap}";