]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/commitdiff
memory.cgi: Use perl mechanism to check if the rrd file for the swap exists.
authorStefan Schantl <stefan.schantl@ipfire.org>
Mon, 17 May 2021 20:53:23 +0000 (22:53 +0200)
committerMichael Tremer <michael.tremer@ipfire.org>
Thu, 10 Jun 2021 13:30:55 +0000 (14:30 +0100)
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
html/cgi-bin/memory.cgi

index 89fa7d14a380b98ecc441bf83bab201b96de168e..dea7e36685f85116077be65406464e7074800be5 100644 (file)
@@ -56,7 +56,7 @@ if ( $querry[0] =~ "memory"){
        &Graphs::makegraphbox("memory.cgi","memory","day");
        &Header::closebox();
 
-       if ( `ls $mainsettings{'RRDLOG'}/collectd/localhost/swap 2>/dev/null` ) {
+       if (-f $mainsettings{'RRDLOG'}/collectd/localhost/swap) {
            &Header::openbox('100%', 'center', "Swap $Lang::tr{'graph'}");
            &Graphs::makegraphbox("memory.cgi","swap","day");
            &Header::closebox();