From 570307f47d08ab76b50e803ea1cd1ef1b83a1689 Mon Sep 17 00:00:00 2001 From: Sylvestre Ho Date: Tue, 8 Feb 2011 16:52:17 +0000 Subject: [PATCH] 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 --- src/check_centreon_snmp_remote_storage | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/check_centreon_snmp_remote_storage b/src/check_centreon_snmp_remote_storage index 5a145bb8d..d18d1c507 100644 --- a/src/check_centreon_snmp_remote_storage +++ b/src/check_centreon_snmp_remote_storage @@ -288,7 +288,7 @@ if ($opt_n) { } my $expr = ""; - if ($opt_d =~ m/^[A-Za-z]:/) { + if ($opt_d =~ m/^[A-Za-z]:/i) { $opt_d =~ s/\\/\\\\/g; $expr = "^$opt_d"; }elsif ($opt_d =~ m/^\//) { @@ -301,13 +301,16 @@ if ($opt_n) { $countLine = 0; while ($row = ){ if ($countLine) { - my @resLine = split(/\;/, $row); + my @resLine = split(/\;/, $row); if ($resLine[1] =~ m/$expr/) { $partition = $resLine[0]; } } $countLine++; } + if ($countLine == 1) { + unlink($cacheFile); + } close(FILE); }