Przy piwie PiHole stats

U

Usunięty użytkownik pigers

Guest
jakby ktoś potrzebował :
Bash:
#Setting section
SERVER=192.168.88.220
API="summaryRaw"
#end of settings section

#check for required software
command -v curl >/dev/null 2>&1 || { echo "I require curl but it's not installed.  Aborting." >&2; exit 1; }
command -v jq >/dev/null 2>&1 || { echo "I require jq but it's not installed.  Aborting." >&2; exit 1; }

if [[ $1 == "--help" ]]; then
echo "Execute script as $0"
echo "Requires to work: curl,jq"
exit 0
fi

if [[ $1 == "--debug" ]]; then
echo "Execute script as $0"
curl -ks "http://$SERVER/admin/api.php?$API" | jq .
exit 0
fi

# main body
VAR=$(curl -ks "http://$SERVER/admin/api.php?$API")
#echo $VAR
PI_ENABLED=$(echo $VAR | jq ".status")
PI_CLIENTS=$(echo $VAR | jq ".clients_ever_seen")
PI_BLOCKEDDOMAINCOUNT=$(echo $VAR | jq ".domains_being_blocked")
PI_BLOCKEDPCT=$(echo $VAR | jq ".ads_percentage_today")
echo "PiHole is now $PI_ENABLED, serving $PI_CLIENTS clients."
echo "Blocking $PI_BLOCKEDDOMAINCOUNT domains. Blocked entries today $PI_BLOCKEDPCT"[/bash]

gdzie [icode]SERVER[/icode] to adres IP pi.hole'a do podmiany.
 

Mogą Cię zainteresować

U
  • Zamknięte
  • Pytanie
Przy piwie PiHole stats
Odpowiedzi
0
Wyświetleń
404
Kontenery Docker i LXD
Usunięty użytkownik pigers
U
U
  • Pytanie
Instruktaż/Tutorial PiHole stats
Odpowiedzi
1
Wyświetleń
688
Oh'Linux? Software hacking
Usunięty użytkownik pigers
U