diff --git a/Check.pm b/Check.pm index 7ea3513..4f3d9b8 100644 --- a/Check.pm +++ b/Check.pm @@ -167,23 +167,6 @@ EOF sub size_consistency { - my $host = undef; - my $entity = undef; - my $pretty = 0; - - GetOptions( - "host=s" => \$host, - "entity=s" => \$entity, - "pretty" => \$pretty - ); - - # We need to switch to backuppc UID/GID - my $uid = getuid(); - my $gid = getgid(); - my (undef,undef,$bkpuid,$bkpgid) = getpwnam('backuppc'); - setuid($bkpuid) if ($uid ne $bkpuid); - setgid($bkpgid) if ($gid ne $bkpgid); - my $bpc = BackupPC::Lib->new(); my $mainConf = $bpc->ConfigDataRead(); my $json = {}; @@ -333,6 +316,9 @@ sub size_consistency else { my $sizeConsistency = print("ANOMALOUS"); } + + chomp $sizeConsistency; + return $sizeConsistency; } 1;