diff --git a/data.php b/data.php index 4fac0ad9..66d81594 100644 --- a/data.php +++ b/data.php @@ -1,14 +1,12 @@ - 1 ? $domains : - file("/etc/pihole/gravity.list"); + //returns count of domains in blocklist. + $file="/etc/pihole/gravity.list"; + $linecount = 0; + $handle = fopen($file, "r"); + while(!feof($handle)){ + $line = fgets($handle); + $linecount++; + } + + fclose($handle); + + return $linecount; + } function readInLog() { global $log;