mirror of https://github.com/Zelo72/rpi
1.0.7 - initiale Pihole 5.x Kompatiblität
This commit is contained in:
parent
f72ca57208
commit
b25ab25725
|
@ -96,7 +96,10 @@ writeLog "[I] Logverzeichnis $logDir bereinigt."
|
||||||
piholeDir=/etc/pihole
|
piholeDir=/etc/pihole
|
||||||
piholeBinDir=/usr/local/bin
|
piholeBinDir=/usr/local/bin
|
||||||
gravityDB=$piholeDir/gravity.db
|
gravityDB=$piholeDir/gravity.db
|
||||||
pihole5=$([ -f "$gravityDB" ])
|
pihole5=0
|
||||||
|
if [ -f "$gravityDB" ]; then
|
||||||
|
pihole5=1
|
||||||
|
fi
|
||||||
gravListPihole=$piholeDir/gravity.list
|
gravListPihole=$piholeDir/gravity.list
|
||||||
gravListBeforeUpdate=$tmp/gravity_before_update.list
|
gravListBeforeUpdate=$tmp/gravity_before_update.list
|
||||||
gravListDiff=$tmp/gravity_diff.list
|
gravListDiff=$tmp/gravity_diff.list
|
||||||
|
@ -198,7 +201,7 @@ fi
|
||||||
# AKtuelle Gravity Liste vom Pi-hole zwischenspeichern und
|
# AKtuelle Gravity Liste vom Pi-hole zwischenspeichern und
|
||||||
# Pi-hole Gravity aktualisieren
|
# Pi-hole Gravity aktualisieren
|
||||||
# Kompatiblitaet fuer Pihole 5.x
|
# Kompatiblitaet fuer Pihole 5.x
|
||||||
if [ "$pihole5" ]; then
|
if [ "$pihole5" -eq 1 ]; then
|
||||||
writeLog "[I] Exportiere Domains aus $gravityDB nach $gravListBeforeUpdate ..."
|
writeLog "[I] Exportiere Domains aus $gravityDB nach $gravListBeforeUpdate ..."
|
||||||
sqlite3 "$gravityDB" "select domain from vw_gravity;" >$gravListBeforeUpdate
|
sqlite3 "$gravityDB" "select domain from vw_gravity;" >$gravListBeforeUpdate
|
||||||
writeLog "[I] Aktualisiere Pi-hole Gravity in $gravityDB ..."
|
writeLog "[I] Aktualisiere Pi-hole Gravity in $gravityDB ..."
|
||||||
|
@ -230,7 +233,7 @@ fi
|
||||||
# $gravListDiff Datei zur weiteren Auswertung speichern
|
# $gravListDiff Datei zur weiteren Auswertung speichern
|
||||||
writeLog "[I] Erstelle Aenderungs-Gravityliste $gravListDiff ..."
|
writeLog "[I] Erstelle Aenderungs-Gravityliste $gravListDiff ..."
|
||||||
# Kompatiblitaet fuer Pihole 5.x
|
# Kompatiblitaet fuer Pihole 5.x
|
||||||
if [ "$pihole5" ]; then
|
if [ "$pihole5" -eq 1 ]; then
|
||||||
writeLog "[I] Exportiere Domains aus $gravityDB nach $tmp/gravity.list ..."
|
writeLog "[I] Exportiere Domains aus $gravityDB nach $tmp/gravity.list ..."
|
||||||
sqlite3 "$gravityDB" "select domain from vw_gravity;" >$tmp/gravity.list
|
sqlite3 "$gravityDB" "select domain from vw_gravity;" >$tmp/gravity.list
|
||||||
gravListPihole=$tmp/gravity.list
|
gravListPihole=$tmp/gravity.list
|
||||||
|
@ -250,7 +253,7 @@ else
|
||||||
phStatus="OFFLINE!"
|
phStatus="OFFLINE!"
|
||||||
fi
|
fi
|
||||||
# Kompatiblitaet fuer Pihole 5.x
|
# Kompatiblitaet fuer Pihole 5.x
|
||||||
if [ "$pihole5" ]; then
|
if [ "$pihole5" -eq 1 ]; then
|
||||||
writeLog "[I] Exportiere Blacklist, RegExlisten, Whitelist und Adlists aus $gravityDB nach $tmp ..."
|
writeLog "[I] Exportiere Blacklist, RegExlisten, Whitelist und Adlists aus $gravityDB nach $tmp ..."
|
||||||
sqlite3 "$gravityDB" "select domain from vw_blacklist;" >$tmp/blacklist.txt
|
sqlite3 "$gravityDB" "select domain from vw_blacklist;" >$tmp/blacklist.txt
|
||||||
blacklist=$tmp/blacklist.txt
|
blacklist=$tmp/blacklist.txt
|
||||||
|
@ -276,9 +279,9 @@ echo ""
|
||||||
echo "# Raspberry Info #"
|
echo "# Raspberry Info #"
|
||||||
echo ""
|
echo ""
|
||||||
echo "Hostname: $(hostname)"
|
echo "Hostname: $(hostname)"
|
||||||
echo "CPU Temperatur: $(($(cat /sys/class/thermal/thermal_zone0/temp) / 1000)) Grad"
|
#echo "CPU Temperatur: $(($(cat /sys/class/thermal/thermal_zone0/temp) / 1000)) Grad"
|
||||||
echo "RAM Nutzung: $(awk '/^Mem/ {printf("%.2f%%", 100*($2-$4-$6)/$2);}' <(free -m))"
|
#echo "RAM Nutzung: $(awk '/^Mem/ {printf("%.2f%%", 100*($2-$4-$6)/$2);}' <(free -m))"
|
||||||
echo "HDD Nutzung: $(df -B1 / 2>/dev/null | awk 'END{ print $5 }')"
|
#echo "HDD Nutzung: $(df -B1 / 2>/dev/null | awk 'END{ print $5 }')"
|
||||||
echo "Reboot erforderlich?: $rebootRequired"
|
echo "Reboot erforderlich?: $rebootRequired"
|
||||||
echo ""
|
echo ""
|
||||||
echo "# Pi-hole Info #"
|
echo "# Pi-hole Info #"
|
||||||
|
@ -296,7 +299,7 @@ echo ""
|
||||||
echo "RegEx Blacklist: $(grep -Evc '^#|^$' $regexblacklist)"
|
echo "RegEx Blacklist: $(grep -Evc '^#|^$' $regexblacklist)"
|
||||||
echo "Domains Whitelist: $(grep -Evc '^#|^$' $whitelist)"
|
echo "Domains Whitelist: $(grep -Evc '^#|^$' $whitelist)"
|
||||||
# Kompatiblitaet fuer Pihole 5.x
|
# Kompatiblitaet fuer Pihole 5.x
|
||||||
if [ "$pihole5" ]; then
|
if [ "$pihole5" -eq 1 ]; then
|
||||||
echo "RegEx Blacklist: $(grep -Evc '^#|^$' $regexwhitelist)"
|
echo "RegEx Blacklist: $(grep -Evc '^#|^$' $regexwhitelist)"
|
||||||
fi
|
fi
|
||||||
echo "Aktive Blocklisten: $(grep -Evc '^#|^$' $adlists)"
|
echo "Aktive Blocklisten: $(grep -Evc '^#|^$' $adlists)"
|
||||||
|
|
Loading…
Reference in New Issue