mirror of
https://github.com/pi-hole/pi-hole.git
synced 2025-04-05 07:00:19 +00:00
Speedtest range set
This commit is contained in:
parent
7c50f0bb19
commit
269c6b9f69
1 changed files with 13 additions and 2 deletions
|
@ -31,7 +31,9 @@ Options:
|
||||||
-i, interface Specify dnsmasq's interface listening behavior
|
-i, interface Specify dnsmasq's interface listening behavior
|
||||||
Add '-h' for more info on interface usage
|
Add '-h' for more info on interface usage
|
||||||
-s, speedtest Set speedtest intevel , user 0 to disable Speedtests
|
-s, speedtest Set speedtest intevel , user 0 to disable Speedtests
|
||||||
use -sn to prevent logging to results list"
|
use -sn to prevent logging to results list
|
||||||
|
-sd Set speedtest display range"
|
||||||
|
|
||||||
exit 0
|
exit 0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -335,8 +337,8 @@ RunSpeedtestNow(){
|
||||||
echo ""
|
echo ""
|
||||||
else
|
else
|
||||||
cp /var/www/html/admin/scripts/pi-hole/speedtest/speedtest.db $speedtestdb
|
cp /var/www/html/admin/scripts/pi-hole/speedtest/speedtest.db $speedtestdb
|
||||||
|
sleep 2
|
||||||
fi
|
fi
|
||||||
sleep 2
|
|
||||||
if [ -f "$lockfile" ]
|
if [ -f "$lockfile" ]
|
||||||
then
|
then
|
||||||
echo "Speedtest is already in progress, is something went wrong delete this file - "$lockfile
|
echo "Speedtest is already in progress, is something went wrong delete this file - "$lockfile
|
||||||
|
@ -389,6 +391,14 @@ CustomizeAdLists() {
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function UpdateSpeedTestRange(){
|
||||||
|
if [[ "${args[2]}" =~ ^[0-9]+$ ]]; then
|
||||||
|
if [ "${args[2]}" -ge 0 -a "${args[2]}" -le 30 ]; then
|
||||||
|
change_setting "SPEEDTEST_CHART_DAYS" "${args[2]}"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
SetPrivacyMode() {
|
SetPrivacyMode() {
|
||||||
if [[ "${args[2]}" == "true" ]]; then
|
if [[ "${args[2]}" == "true" ]]; then
|
||||||
change_setting "API_PRIVACY_MODE" "true"
|
change_setting "API_PRIVACY_MODE" "true"
|
||||||
|
@ -513,6 +523,7 @@ main() {
|
||||||
"-t" | "teleporter" ) Teleporter;;
|
"-t" | "teleporter" ) Teleporter;;
|
||||||
"adlist" ) CustomizeAdLists;;
|
"adlist" ) CustomizeAdLists;;
|
||||||
"-s" | "speedtest" ) ChageSpeedTestSchedule;;
|
"-s" | "speedtest" ) ChageSpeedTestSchedule;;
|
||||||
|
"-sd" ) UpdateSpeedTestRange;;
|
||||||
"-sn" ) RunSpeedtestNow;;
|
"-sn" ) RunSpeedtestNow;;
|
||||||
* ) helpFunc;;
|
* ) helpFunc;;
|
||||||
esac
|
esac
|
||||||
|
|
Loading…
Add table
Reference in a new issue