mirror of
https://github.com/pi-hole/web.git
synced 2024-12-06 19:36:21 +01:00
Update index.php
Consume JSON output of chronometer.sh Relies on [this pull](jacobsalmela/pi-hole#193) being merged.
This commit is contained in:
@@ -1,8 +1,10 @@
|
||||
<?php
|
||||
$domains_being_blocked = exec("wc -l /etc/pihole/pihole.3.eventHorizon.txt | awk '{print $1}'");
|
||||
$dns_queries_today = exec("cat /var/log/pihole.log | awk '/query/ {print $6}' | wc -l");
|
||||
$ads_blocked_today = exec("cat /var/log/pihole.log | awk '/\/etc\/pihole\/gravity.list/ && !/address/ {print $6}' | wc -l");
|
||||
$ads_percentage_today = $ads_blocked_today / $dns_queries_today * 100;
|
||||
$output = exec('/usr/local/bin/chronometer.sh -j');
|
||||
$outj = json_decode($output);
|
||||
$domains_being_blocked = $outj->domains_being_blocked;
|
||||
$dns_queries_today = $outj->dns_queries_today;
|
||||
$ads_blocked_today = $outj->ads_blocked_today;
|
||||
$ads_percentage_today = $outj->ads_percentage_today;
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
|
||||
Reference in New Issue
Block a user