mirror of https://github.com/jimsalterjrs/sanoid
Compare commits
2 Commits
e51fce25d3
...
543d7bd3bf
| Author | SHA1 | Date |
|---|---|---|
|
|
543d7bd3bf | |
|
|
ebcedbc89b |
23
syncoid
23
syncoid
|
|
@ -923,7 +923,22 @@ sub runsynccmd {
|
|||
if (defined $args{'restore-properties'}) {
|
||||
foreach my $key (keys %properties) {
|
||||
my $value = $properties{$key};
|
||||
my ($skey, $ikey) = split(/:/, $key);
|
||||
my @parts = split(/:/, $key);
|
||||
my $skey = "";
|
||||
my $ikey = "";
|
||||
my $is_recursive = 0;
|
||||
if (@parts > 2) {
|
||||
if($parts[0] eq 'syncoid' && $parts[1] eq 'syncoid') {
|
||||
shift @parts;
|
||||
$skey = $parts[0];
|
||||
$ikey = join(':', @parts);
|
||||
$is_recursive = 1;
|
||||
}
|
||||
} else {
|
||||
$skey = $parts[0];
|
||||
$ikey = $parts[1];
|
||||
}
|
||||
#my ($skey, $ikey) = split(/:/, $key);
|
||||
if (!length($ikey)) {
|
||||
my $skeypresent = 0;
|
||||
foreach my $key1 (keys %properties) {
|
||||
|
|
@ -942,6 +957,7 @@ sub runsynccmd {
|
|||
}
|
||||
}
|
||||
} else {
|
||||
if (!$is_recursive) {
|
||||
if(!istargetpropertypresent($ikey)) {
|
||||
if($value eq "*default*") {
|
||||
writelog('DEBUG', "will unset $ikey ...");
|
||||
|
|
@ -952,6 +968,11 @@ sub runsynccmd {
|
|||
$recvoptions .= " -o $pair";
|
||||
}
|
||||
}
|
||||
} else {
|
||||
writelog('DEBUG', "will set $ikey to $value ...");
|
||||
my $pair = escapeshellparam("$ikey=$value");
|
||||
$recvoptions .= " -o $pair";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue