mirror of
https://github.com/pi-hole/pi-hole.git
synced 2025-04-23 15:50:19 +00:00
pihole update compatibility
This commit is contained in:
parent
e5a5fc21e6
commit
546123f8b4
1 changed files with 17 additions and 0 deletions
|
@ -14,6 +14,7 @@ readonly dhcpconfig="/etc/dnsmasq.d/02-pihole-dhcp.conf"
|
||||||
# 03 -> wildcards
|
# 03 -> wildcards
|
||||||
readonly dhcpstaticconfig="/etc/dnsmasq.d/04-pihole-static-dhcp.conf"
|
readonly dhcpstaticconfig="/etc/dnsmasq.d/04-pihole-static-dhcp.conf"
|
||||||
readonly speedtestfile="/var/www/html/admin/scripts/pi-hole/speedtest/speedtest.sh"
|
readonly speedtestfile="/var/www/html/admin/scripts/pi-hole/speedtest/speedtest.sh"
|
||||||
|
readonly speedtestdb="/opt/pihole/speedtest.db"
|
||||||
|
|
||||||
helpFunc() {
|
helpFunc() {
|
||||||
echo "Usage: pihole -a [options]
|
echo "Usage: pihole -a [options]
|
||||||
|
@ -327,12 +328,28 @@ ChageSpeedTestSchedule(){
|
||||||
}
|
}
|
||||||
|
|
||||||
RunSpeedtestNow(){
|
RunSpeedtestNow(){
|
||||||
|
mkdir -p /tmp/speedtest
|
||||||
|
lockfile="/tmp/speedtest/lock"
|
||||||
|
if [ -f $speedtestdb ]
|
||||||
|
then
|
||||||
|
echo ""
|
||||||
|
else
|
||||||
|
cp /var/www/html/admin/scripts/pi-hole/speedtest/speedtest.db $speedtestdb
|
||||||
|
fi
|
||||||
|
sleep 2
|
||||||
|
if [ -f "$lockfile" ]
|
||||||
|
then
|
||||||
|
echo "Speedtest is already in progress, is something went wrong delete this file - "$lockfile
|
||||||
|
else
|
||||||
|
touch $lockfile
|
||||||
if [[ "${args[2]}" == "-n" ]]; then
|
if [[ "${args[2]}" == "-n" ]]; then
|
||||||
speedtest-cli
|
speedtest-cli
|
||||||
else
|
else
|
||||||
echo "Testing Speed"
|
echo "Testing Speed"
|
||||||
result=`$speedtestfile`
|
result=`$speedtestfile`
|
||||||
echo $result
|
echo $result
|
||||||
|
rm $lockfile
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue