mirror of
https://github.com/pi-hole/pi-hole.git
synced 2025-04-04 14:40:15 +00:00
Custom server support
Flush history support
This commit is contained in:
parent
995f15b99e
commit
e5f43c8d45
1 changed files with 22 additions and 1 deletions
|
@ -32,7 +32,9 @@ Options:
|
|||
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
|
||||
-sd Set speedtest display range"
|
||||
-sd Set speedtest display range
|
||||
-sc Clear speedtest data"
|
||||
-ss Set custom server"
|
||||
|
||||
exit 0
|
||||
}
|
||||
|
@ -320,6 +322,11 @@ SetWebUILayout() {
|
|||
}
|
||||
|
||||
|
||||
ClearSpeedtestData(){
|
||||
mv $speedtestdb $speedtestdb"_old"
|
||||
cp /var/www/html/admin/scripts/pi-hole/speedtest/speedtest.db $speedtestdb
|
||||
}
|
||||
|
||||
ChageSpeedTestSchedule(){
|
||||
if [[ "${args[2]}" =~ ^[0-9]+$ ]]; then
|
||||
if [ "${args[2]}" -ge 0 -a "${args[2]}" -le 24 ]; then
|
||||
|
@ -329,6 +336,18 @@ ChageSpeedTestSchedule(){
|
|||
fi
|
||||
}
|
||||
|
||||
SpeedtestServer(){
|
||||
if [[ "${args[2]}" =~ ^[0-9]+$ ]]; then
|
||||
change_setting "SPEEDTEST_SERVER" "${args[2]}"
|
||||
# SetCronTab ${args[2]}
|
||||
else
|
||||
# Autoselect for invalid data
|
||||
change_setting "SPEEDTEST_SERVER" ""
|
||||
fi
|
||||
|
||||
}
|
||||
|
||||
|
||||
RunSpeedtestNow(){
|
||||
mkdir -p /tmp/speedtest
|
||||
lockfile="/tmp/speedtest/lock"
|
||||
|
@ -525,6 +544,8 @@ main() {
|
|||
"-s" | "speedtest" ) ChageSpeedTestSchedule;;
|
||||
"-sd" ) UpdateSpeedTestRange;;
|
||||
"-sn" ) RunSpeedtestNow;;
|
||||
"-sc" ) ClearSpeedtestData;;
|
||||
"-ss" ) SpeedtestServer;;
|
||||
* ) helpFunc;;
|
||||
esac
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue