diff --git a/syncoid b/syncoid index 7ee12e2..af20af8 100755 --- a/syncoid +++ b/syncoid @@ -39,6 +39,15 @@ if (defined $args{'c'}) { $sshcipher = '-c chacha20-poly1305@openssh.com,arcfour'; } my $sshport = '-p 22'; +my $sshoption; +if (defined $args{'o'}) { + $sshoption = "-o $args{'o'}"; + if ($sshoption eq "NoneSwitch=yes"){ + $sshcipher = "" + } +} else { + $sshoption = ""; +} my $pvcmd = '/usr/bin/pv'; my $mbuffercmd = '/usr/bin/mbuffer'; my $sudocmd = '/usr/bin/sudo'; @@ -52,10 +61,10 @@ if ( $args{'sshport'} ) { } # figure out if source and/or target are remote. if ( $args{'sshkey'} ) { - $sshcmd = "$sshcmd $sshcipher $sshport -i $args{'sshkey'}"; + $sshcmd = "$sshcmd $sshoption $sshcipher $sshport -i $args{'sshkey'}"; } else { - $sshcmd = "$sshcmd $sshcipher $sshport"; + $sshcmd = "$sshcmd $sshoption $sshcipher $sshport"; } my ($sourcehost,$sourcefs,$sourceisroot) = getssh($rawsourcefs); my ($targethost,$targetfs,$targetisroot) = getssh($rawtargetfs); @@ -329,7 +338,7 @@ sub getargs { my %novaluearg; my %validarg; - push my @validargs, ('debug','nocommandchecks','version','monitor-version','compress','c','source-bwlimit','target-bwlimit','dumpsnaps','recursive','r','sshkey','sshport','quiet','no-stream','no-sync-snap'); + push my @validargs, ('debug','nocommandchecks','version','monitor-version','compress','c','o','source-bwlimit','target-bwlimit','dumpsnaps','recursive','r','sshkey','sshport','quiet','no-stream','no-sync-snap'); foreach my $item (@validargs) { $validarg{$item} = 1; } push my @novalueargs, ('debug','nocommandchecks','version','monitor-version','dumpsnaps','recursive','r','quiet','no-stream','no-sync-snap'); foreach my $item (@novalueargs) { $novaluearg{$item} = 1; }