Skip to content

Commit

Permalink
use sudo if neccessary for checking pool capabilities regarding resum…
Browse files Browse the repository at this point in the history
…eable send
  • Loading branch information
phreaker0 committed Apr 20, 2020
1 parent e6c5aa0 commit 0e80738
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions syncoid
Original file line number Diff line number Diff line change
Expand Up @@ -1067,11 +1067,11 @@ sub checkcommands {
my $resumechkcmd = "$zpoolcmd get -o value -H feature\@extensible_dataset";

if ($debug) { print "DEBUG: checking availability of zfs resume feature on source...\n"; }
$avail{'sourceresume'} = system("$sourcessh $resumechkcmd $srcpool 2>/dev/null | grep '\\(active\\|enabled\\)' >/dev/null 2>&1");
$avail{'sourceresume'} = system("$sourcessh $sourcesudocmd $resumechkcmd $srcpool 2>/dev/null | grep '\\(active\\|enabled\\)' >/dev/null 2>&1");
$avail{'sourceresume'} = $avail{'sourceresume'} == 0 ? 1 : 0;

if ($debug) { print "DEBUG: checking availability of zfs resume feature on target...\n"; }
$avail{'targetresume'} = system("$targetssh $resumechkcmd $dstpool 2>/dev/null | grep '\\(active\\|enabled\\)' >/dev/null 2>&1");
$avail{'targetresume'} = system("$targetssh $targetsudocmd $resumechkcmd $dstpool 2>/dev/null | grep '\\(active\\|enabled\\)' >/dev/null 2>&1");
$avail{'targetresume'} = $avail{'targetresume'} == 0 ? 1 : 0;

if ($avail{'sourceresume'} == 0 || $avail{'targetresume'} == 0) {
Expand Down

0 comments on commit 0e80738

Please sign in to comment.