mirror of
https://github.com/centreon/centreon-plugins.git
synced 2025-07-23 21:55:16 +02:00
delete cache file if it contains one line only
git-svn-id: http://svn.centreon.com/trunk/plugins-2.x@11630 6bcd3966-0018-0410-8128-fd23d134de7e
This commit is contained in:
parent
d7d58f969c
commit
570307f47d
@ -288,7 +288,7 @@ if ($opt_n) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
my $expr = "";
|
my $expr = "";
|
||||||
if ($opt_d =~ m/^[A-Za-z]:/) {
|
if ($opt_d =~ m/^[A-Za-z]:/i) {
|
||||||
$opt_d =~ s/\\/\\\\/g;
|
$opt_d =~ s/\\/\\\\/g;
|
||||||
$expr = "^$opt_d";
|
$expr = "^$opt_d";
|
||||||
}elsif ($opt_d =~ m/^\//) {
|
}elsif ($opt_d =~ m/^\//) {
|
||||||
@ -301,13 +301,16 @@ if ($opt_n) {
|
|||||||
$countLine = 0;
|
$countLine = 0;
|
||||||
while ($row = <FILE>){
|
while ($row = <FILE>){
|
||||||
if ($countLine) {
|
if ($countLine) {
|
||||||
my @resLine = split(/\;/, $row);
|
my @resLine = split(/\;/, $row);
|
||||||
if ($resLine[1] =~ m/$expr/) {
|
if ($resLine[1] =~ m/$expr/) {
|
||||||
$partition = $resLine[0];
|
$partition = $resLine[0];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$countLine++;
|
$countLine++;
|
||||||
}
|
}
|
||||||
|
if ($countLine == 1) {
|
||||||
|
unlink($cacheFile);
|
||||||
|
}
|
||||||
close(FILE);
|
close(FILE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user