]> git.ipfire.org Git - people/stevee/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)
committerStefan Schantl <stefan.schantl@ipfire.org>
Thu, 20 May 2021 15:42:41 +0000 (17:42 +0200)
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
html/cgi-bin/memory.cgi

index 204365294e1cfa9446402e1f52c8805b4e514d7a..214f18059f57a4dde81bf5b3777e0189c127873c 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();