Commandline speedtest added

This commit is contained in:
Siddhu 2017-07-15 16:23:38 +05:30
parent 8f9d4d04af
commit 3c43cf2d3d

View file

@ -30,7 +30,7 @@ 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
" add -n to prevent logging to results list"
exit 0 exit 0
} }
@ -326,6 +326,16 @@ ChageSpeedTestSchedule(){
fi fi
} }
RunSpeedtestNow(){
if [[ "${args[2]}" == "-n" ]]; then
speedtest-cli
else
echo "Testing Speed"
result=`$speedtestfile`
echo $result
fi
}
SetCronTab() SetCronTab()
{ {
# Remove OLD # Remove OLD
@ -486,6 +496,7 @@ main() {
"-t" | "teleporter" ) Teleporter;; "-t" | "teleporter" ) Teleporter;;
"adlist" ) CustomizeAdLists;; "adlist" ) CustomizeAdLists;;
"-s" | "speedtest" ) ChageSpeedTestSchedule;; "-s" | "speedtest" ) ChageSpeedTestSchedule;;
"-sn" ) RunSpeedtestNow;;
* ) helpFunc;; * ) helpFunc;;
esac esac