Speedtest range set

This commit is contained in:
Siddhu 2017-07-17 23:17:32 +05:30
parent 7c50f0bb19
commit 269c6b9f69

View file

@ -31,7 +31,9 @@ Options:
-i, interface Specify dnsmasq's interface listening behavior
Add '-h' for more info on interface usage
-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
}
@ -335,8 +337,8 @@ RunSpeedtestNow(){
echo ""
else
cp /var/www/html/admin/scripts/pi-hole/speedtest/speedtest.db $speedtestdb
sleep 2
fi
sleep 2
if [ -f "$lockfile" ]
then
echo "Speedtest is already in progress, is something went wrong delete this file - "$lockfile
@ -389,6 +391,14 @@ CustomizeAdLists() {
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() {
if [[ "${args[2]}" == "true" ]]; then
change_setting "API_PRIVACY_MODE" "true"
@ -513,6 +523,7 @@ main() {
"-t" | "teleporter" ) Teleporter;;
"adlist" ) CustomizeAdLists;;
"-s" | "speedtest" ) ChageSpeedTestSchedule;;
"-sd" ) UpdateSpeedTestRange;;
"-sn" ) RunSpeedtestNow;;
* ) helpFunc;;
esac