diff --git a/luci-app-autotimeset/Makefile b/luci-app-autotimeset/Makefile index 8fbbf234..d4808107 100644 --- a/luci-app-autotimeset/Makefile +++ b/luci-app-autotimeset/Makefile @@ -1,15 +1,18 @@ -# Copyright (C) 2019-2023 sirpdboy https://github.com/sirpdboy/luci-app-autotimeset -# +# +# Copyright 2019-2023 sirpdboy +# # This is free software, licensed under the Apache License, Version 2.0 . # include $(TOPDIR)/rules.mk +NAME:=autotimeset +PKG_NAME:=luci-app-$(NAME) LUCI_TITLE:=LuCI support for Scheduled Time setting LUCI_PKGARCH:=all -PKG_VERSION:=2.0.2 -PKG_RELEASE:=20230718 +PKG_VERSION:=2.1.0 +PKG_RELEASE:=20240311 define Package/$(PKG_NAME)/conffiles diff --git a/luci-app-autotimeset/luasrc/controller/autotimeset.lua b/luci-app-autotimeset/luasrc/controller/autotimeset.lua index 1f5138eb..da33581c 100644 --- a/luci-app-autotimeset/luasrc/controller/autotimeset.lua +++ b/luci-app-autotimeset/luasrc/controller/autotimeset.lua @@ -6,7 +6,9 @@ function index() return end entry({"admin", "control"}, firstchild(), "Control", 44).dependent = false - entry({"admin", "control", "autotimeset"}, alias("admin", "control", "autotimeset", "base"), _("Scheduled Setting"), 20).dependent = true + local e = entry({"admin", "control", "autotimeset"}, alias("admin", "control", "autotimeset", "base"), _("Scheduled Setting"), 20) + e.dependent = false + e.acl_depends = { "luci-app-autotimeset" } entry({"admin", "control", "autotimeset", "base"}, cbi("autotimeset/base"), _("Scheduled Setting"), 1).leaf = true entry({"admin", "control", "autotimeset", "log"}, form("autotimeset/log"), _("Log"), 2).leaf = true entry({"admin","control","autotimeset","dellog"},call("dellog")) diff --git a/luci-app-autotimeset/luasrc/model/cbi/autotimeset/base.lua b/luci-app-autotimeset/luasrc/model/cbi/autotimeset/base.lua index dcc4a94b..babb72ed 100644 --- a/luci-app-autotimeset/luasrc/model/cbi/autotimeset/base.lua +++ b/luci-app-autotimeset/luasrc/model/cbi/autotimeset/base.lua @@ -5,18 +5,19 @@ local e=luci.model.uci.cursor() local m,s,e m=Map("autotimeset",translate("Scheduled task/startup task settings"),translate("The original [Timing Settings] includes scheduled task execution and startup task execution. Presets include over 10 functions, including restart, shutdown, network restart, memory release, system cleaning, network sharing, network shutdown, automatic detection of network disconnects and reconnection, MWAN3 load balancing detection of reconnection, and custom scripts
") .. -translate("N1-N5 is continuous, N1, N3, N5 is discontinuous, */N represents every N hours or every N minutes.The week can only be 0~6, the hour can only be 0~23, the minute can only be 0~59, the unavailable time is 48 hours.") .. -translate("   ")) +translate("N1-N5 is continuous, N1, N3, N5 is discontinuous, */N represents every N hours or every N minutes.The week can only be 0~6, the hour can only be 0~23, the minute can only be 0~59, the unavailable time is 48 hours.")) s = m:section(TypedSection, 'global') s.anonymous=true e=s:option(TextValue, "customscript" ,translate("Edit Custom Script")) -e.description = translate("Only by editing the content of the custom script well and scheduling the custom script task can it be executed effectively.") +e.description = translate("The execution content of the [Scheduled Customscript] in the task name") +e.rows = 5 +e.rmempty = false + +e=s:option(TextValue, "customscript2" ,translate("Edit Custom Script2")) +e.description = translate("The execution content of the [Scheduled Customscript2] in the task name") e.rows = 5 -e.default = '#!/bin/sh' e.rmempty = false s=m:section(TypedSection,"stime","") @@ -37,8 +38,15 @@ e:value(9,translate("Scheduled DisReconn")) e:value(10,translate("Scheduled DisRereboot")) e:value(11,translate("Scheduled Restartmwan3")) e:value(12,translate("Scheduled Customscript")) +e:value(13,translate("Scheduled Customscript2")) +e:value(14,translate("Scheduled Wifiup")) +e:value(15,translate("Scheduled Wifidown")) e.default=2 +e=s:option(Flag,"enable",translate("Enable")) +e.rmempty = false +e.default=0 + e=s:option(ListValue,"ttype",translate("Task Type")) e:value(0,translate("Scheduled task execution")) e:value(1,translate("Startup task")) @@ -71,10 +79,6 @@ e=s:option(Value,"minute",translate("Minute(0~59)")) e.rmempty = false e.default = 0 -e=s:option(Flag,"enable",translate("Enable")) -e.rmempty = false -e.default=0 - m.apply_on_parse = true m.on_after_apply = function(self,map) luci.sys.exec("/etc/init.d/autotimeset start") diff --git a/luci-app-autotimeset/po/zh-cn/autotimeset.po b/luci-app-autotimeset/po/zh-cn/autotimeset.po index ebb4ecc8..9b322f0c 100644 --- a/luci-app-autotimeset/po/zh-cn/autotimeset.po +++ b/luci-app-autotimeset/po/zh-cn/autotimeset.po @@ -65,14 +65,29 @@ msgstr "检测断网重启" msgid "Scheduled Restartmwan3" msgstr "检测MWAN3失联重启服务" +msgid "Scheduled Wifidown" +msgstr "关闭无线网络" + +msgid "Scheduled Wifiup" +msgstr "启用无线网络" + msgid "Edit Custom Script" -msgstr "编辑自定义脚本" +msgstr "【自定义脚本】编辑" + +msgid "Edit Custom Script2" +msgstr "【自定义脚本2】编辑" msgid "Scheduled Customscript" msgstr "自定义脚本" -msgid "Only by editing the content of the custom script well and scheduling the custom script task can it be executed effectively." -msgstr "编辑好自定义脚本内容,自定义脚本任务才能有效执行。" +msgid "Scheduled Customscript2" +msgstr "自定义脚本2" + +msgid "The execution content of the [Scheduled Customscript] in the task name" +msgstr "任务名称中【自定义脚本】执行内容" + +msgid "The execution content of the [Scheduled Customscript2] in the task name" +msgstr "任务名称中【自定义脚本2】执行内容" msgid "Month(0~11)" msgstr "月份(0~11)【定时用】" diff --git a/luci-app-autotimeset/po/zh_Hans b/luci-app-autotimeset/po/zh_Hans deleted file mode 120000 index 41451e4a..00000000 --- a/luci-app-autotimeset/po/zh_Hans +++ /dev/null @@ -1 +0,0 @@ -zh-cn \ No newline at end of file diff --git a/luci-app-autotimeset/po/zh_Hans/autotimeset.po b/luci-app-autotimeset/po/zh_Hans/autotimeset.po new file mode 100644 index 00000000..9b322f0c --- /dev/null +++ b/luci-app-autotimeset/po/zh_Hans/autotimeset.po @@ -0,0 +1,106 @@ + +msgid "The original [Timing Settings] includes scheduled task execution and startup task execution. Presets include over 10 functions, including restart, shutdown, network restart, memory release, system cleaning, network sharing, network shutdown, automatic detection of network disconnects and reconnection, MWAN3 load balancing detection of reconnection, and custom scripts
" +msgstr "任务设置包括定时任务执行和开机启动任务执行,预置:重启、关机、重启网络、释放内存、系统清理、网络共享、关闭网络、自动检测断网重连、自动检测断网重启、MWAN3负载均衡检测重连、自定义脚本等10多个功能.
" + +msgid "N1-N5 is continuous, N1, N3, N5 is discontinuous, */N represents every N hours or every N minutes.The week can only be 0~6, the hour can only be 0~23, the minute can only be 0~59, the unavailable time is 48 hours." +msgstr "N1-N5连续,N1,N3,N5不连续,*/N表示每N小时或每N分钟。月份范围0-11,星期范围0~6,小时范围0~23,分钟范围0~59,不可用72小时或者90分钟等连续范围。" + +msgid "Scheduled task/startup task settings" +msgstr "定时执行任务/开机启动任务设置" + +msgid "Scheduled Setting" +msgstr "任务设置" + +msgid "Test/Verify Settings" +msgstr "测试/验证设置" + +msgid "Scheduled Type" +msgstr "任务名称" + +msgid "Task Type" +msgstr "任务类型" + +msgid "Scheduled task execution" +msgstr "定时执行任务" + +msgid "Startup task" +msgstr "开机启动任务" + +msgid "Startup delay time" +msgstr "延迟时间【开机用】" + +msgid "Log" +msgstr "日志" + +msgid "Scheduled Reboot" +msgstr "重启机器" + +msgid "Scheduled Poweroff" +msgstr "关闭机器" + +msgid "Scheduled ReNetwork" +msgstr "重启网络" + +msgid "Scheduled RestartSamba" +msgstr "重启网络共享" + +msgid "Scheduled Restartwan" +msgstr "重启WAN" + +msgid "Scheduled Closewan" +msgstr "关闭网络" + +msgid "Scheduled Clearmem" +msgstr "释放内存" + +msgid "Scheduled Sysfree" +msgstr "系统清理(会重启机器)" + +msgid "Scheduled DisReconn" +msgstr "检测断网重连" + +msgid "Scheduled DisRereboot" +msgstr "检测断网重启" + +msgid "Scheduled Restartmwan3" +msgstr "检测MWAN3失联重启服务" + +msgid "Scheduled Wifidown" +msgstr "关闭无线网络" + +msgid "Scheduled Wifiup" +msgstr "启用无线网络" + +msgid "Edit Custom Script" +msgstr "【自定义脚本】编辑" + +msgid "Edit Custom Script2" +msgstr "【自定义脚本2】编辑" + +msgid "Scheduled Customscript" +msgstr "自定义脚本" + +msgid "Scheduled Customscript2" +msgstr "自定义脚本2" + +msgid "The execution content of the [Scheduled Customscript] in the task name" +msgstr "任务名称中【自定义脚本】执行内容" + +msgid "The execution content of the [Scheduled Customscript2] in the task name" +msgstr "任务名称中【自定义脚本2】执行内容" + +msgid "Month(0~11)" +msgstr "月份(0~11)【定时用】" + +msgid "Week Day(0~6)" +msgstr "星期(0~6)【定时用】" + +msgid "Everyday" +msgstr "每天【定时用】" + +msgid "Hour(0~23)" +msgstr "小时(0~23)【定时用】" + +msgid "Minute(0~59)" +msgstr "分钟(0~59)【定时用】" + diff --git a/luci-app-autotimeset/root/etc/autotimeset/timesetcustomscript b/luci-app-autotimeset/root/etc/autotimeset/timesetcustomscript index 1a248525..d118c714 100644 --- a/luci-app-autotimeset/root/etc/autotimeset/timesetcustomscript +++ b/luci-app-autotimeset/root/etc/autotimeset/timesetcustomscript @@ -1 +1 @@ -#!/bin/sh +# Sh script rules diff --git a/luci-app-autotimeset/root/etc/autotimeset/timesetcustomscript2 b/luci-app-autotimeset/root/etc/autotimeset/timesetcustomscript2 new file mode 100644 index 00000000..c3f8fef5 --- /dev/null +++ b/luci-app-autotimeset/root/etc/autotimeset/timesetcustomscript2 @@ -0,0 +1 @@ +# Sh script rules \ No newline at end of file diff --git a/luci-app-autotimeset/root/etc/config/autotimeset b/luci-app-autotimeset/root/etc/config/autotimeset index 34280e07..27631e56 100644 --- a/luci-app-autotimeset/root/etc/config/autotimeset +++ b/luci-app-autotimeset/root/etc/config/autotimeset @@ -1,4 +1,3 @@ - config global option enabled '0' option customscript '#!/bin/sh' @@ -16,12 +15,12 @@ config stime config stime option minute '0' option month '*' - option hour '*/5' option enable '0' option week '1,3,5' - option ttype '1' option delay '10' option stype '1' + option ttype '0' + option hour '1' config stime option week '*' @@ -30,8 +29,8 @@ config stime option ttype '0' option delay '10' option stype '10' - option hour '0' option minute '*/5' + option hour '*' config stime option week '*' @@ -55,21 +54,21 @@ config stime config stime option week '*' - option hour '0' option minute '*/5' option month '*' option stype '11' option ttype '1' option delay '20' option enable '0' + option hour '*' config stime option month '*' option week '*' - option hour '0' option enable '0' option minute '*/5' option stype '12' option ttype '1' option delay '30' + option hour '*' diff --git a/luci-app-autotimeset/root/etc/init.d/autotimeset b/luci-app-autotimeset/root/etc/init.d/autotimeset index 154ea277..5250bf88 100644 --- a/luci-app-autotimeset/root/etc/init.d/autotimeset +++ b/luci-app-autotimeset/root/etc/init.d/autotimeset @@ -8,17 +8,12 @@ LOG=$TMP/autotimeset.log TT=/etc/init.d/autotimesetrun CR=/etc/crontabs/root [ ! -d $TMP ] && mkdir -p $TMP 2>/dev/null -[ -s $LOG ] && echo ' ' >> $LOG +[ -s $LOG ] && echo -e '' >> $LOG run_autotimeset() { ssum=$(grep -c stime /etc/config/autotimeset) -customscript=$(uci -q get autotimeset.@global[0].customscript ) || customscript='#!/bin/sh' -script=`echo $customscript | grep '#!/bin/sh'` >/dev/null 2>&1 -[ $script ] && echo $script > /etc/autotimeset/timesetcustomscript || { - echo '#!/bin/sh' >/etc/autotimeset/timesetcustomscript - echo $customscript >>/etc/autotimeset/timesetcustomscript -} -echo 'start(){' >>$TT +[ `uci -q get autotimeset.@global[0].customscript | wc -l ` > 0 ] && uci -q get autotimeset.@global[0].customscript > /etc/autotimeset/timesetcustomscript +[ `uci -q get autotimeset.@global[0].customscript2 | wc -l ` > 0 ] && uci -q get autotimeset.@global[0].customscript2 > /etc/autotimeset/timesetcustomscript2 for i in $(seq 0 $((ssum-1))) do enable=$(uci -q get autotimeset.@stime[$i].enable ) @@ -73,7 +68,6 @@ do local cmd="$minute $hour * $month $week /usr/bin/timesethandler disrereboot Scheduled_task" [ $ttype = '0' ] && echo "$cmd" >> $CR || echo "sleep $delay && /usr/bin/timesethandler disrereboot Startup_task" >>$TT ;; - 11) local cmd="$minute $hour * $month $week /usr/bin/timesethandler restartmwan3 Scheduled_task" [ $ttype = '0' ] && echo "$cmd" >> $CR || echo "sleep $delay && /usr/bin/timesethandler restartmwan3 Startup_task" >>$TT @@ -82,12 +76,21 @@ do local cmd="$minute $hour * $month $week /usr/bin/timesethandler customscript Scheduled_task" [ $ttype = '0' ] && echo "$cmd" >> $CR || echo "sleep $delay && /usr/bin/timesethandler customscript Startup_task" >>$TT ;; + 13) + local cmd="$minute $hour * $month $week /usr/bin/timesethandler customscript2 Scheduled_task" + [ $ttype = '0' ] && echo "$cmd" >> $CR || echo "sleep $delay && /usr/bin/timesethandler customscript2 Startup_task" >>$TT + ;; + 14) + local cmd="$minute $hour * $month $week /usr/bin/timesethandler upwifi Scheduled_task" + [ $ttype = '0' ] && echo "$cmd" >> $CR || echo "sleep $delay && /usr/bin/timesethandler upwifi Startup_task" >>$TT + ;; + 15) + local cmd="$minute $hour * $month $week /usr/bin/timesethandler downwifi Scheduled_task" + [ $ttype = '0' ] && echo "$cmd" >> $CR || echo "sleep $delay && /usr/bin/timesethandler downwifi Startup_task" >>$TT + ;; esac - fi - done - echo '}' >>$TT } start() @@ -95,12 +98,14 @@ start() del_cru [ -n "`tail -c1 $CR`" ] && echo >> $CR run_autotimeset + echo '}' >>$TT /etc/init.d/cron reload } stop() { del_cru + echo '}' >>$TT /etc/init.d/cron reload } @@ -110,8 +115,8 @@ restart() } del_cru() -{ - echo -e '#!/bin/sh /etc/rc.common\n\nSTART=99\n' > $TT +{ + echo -e '#!/bin/sh /etc/rc.common\n\nSTART=99\nstart(){\necho "Service autotimesetrun started! " >> $LOG\n' > $TT sed -i '/timesethandler/d' $CR >/dev/null 2>&1 } diff --git a/luci-app-autotimeset/root/etc/init.d/autotimesetrun b/luci-app-autotimeset/root/etc/init.d/autotimesetrun index 3ba06fbb..df474bb1 100644 --- a/luci-app-autotimeset/root/etc/init.d/autotimesetrun +++ b/luci-app-autotimeset/root/etc/init.d/autotimesetrun @@ -1,6 +1,5 @@ #!/bin/sh /etc/rc.common - START=99 start(){ -auto=1 +echo "Service autotimesetrun started!" >/dev/null } diff --git a/luci-app-autotimeset/root/etc/uci-defaults/40_luci-app-autotimeset b/luci-app-autotimeset/root/etc/uci-defaults/40_luci-app-autotimeset deleted file mode 100644 index 94da7287..00000000 --- a/luci-app-autotimeset/root/etc/uci-defaults/40_luci-app-autotimeset +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/sh -chmod +x /etc/init.d/autotimeset /usr/bin/timesethandler -uci -q batch <<-EOF >/dev/null - delete ucitrack.@autotimeset[-1] - add ucitrack autotimeset - set ucitrack.@autotimeset[-1].init=autotimeset - commit ucitrack -EOF -rm -rf /tmp/luci-modulecache /tmp/luci-indexcache* -exit 0 diff --git a/luci-app-autotimeset/root/etc/uci-defaults/luci--autotimeset b/luci-app-autotimeset/root/etc/uci-defaults/luci-autotimeset similarity index 100% rename from luci-app-autotimeset/root/etc/uci-defaults/luci--autotimeset rename to luci-app-autotimeset/root/etc/uci-defaults/luci-autotimeset diff --git a/luci-app-autotimeset/root/usr/bin/timesethandler b/luci-app-autotimeset/root/usr/bin/timesethandler index fc44c451..552f0126 100644 --- a/luci-app-autotimeset/root/usr/bin/timesethandler +++ b/luci-app-autotimeset/root/usr/bin/timesethandler @@ -1,6 +1,6 @@ #!/bin/sh # author 2021 jjm2473 -# author 2020-2023 sirpdboy +# author 2020-2024 sirpdboy TMP_T=/var/autotimeset/autotimeset.tmp LOG=/etc/autotimeset/autotimeset.log log(){ @@ -114,10 +114,29 @@ trigger() { [ -s /usr/sbin/mwan3 ] && remwan3 ;; customscript) - script=`cat /etc/autotimeset/timesetcustomscript ` >/dev/null 2>&1 - [ $script ] && source /etc/autotimeset/timesetcustomscript + script=`cat /etc/autotimeset/timesetcustomscript | wc -l` + [[ $script > 0 ]] && source /etc/autotimeset/timesetcustomscript log "CustomScript succeeded!" ;; + customscript2) + script=`cat /etc/autotimeset/timesetcustomscript2 | wc -l` + [[ $script > 0 ]] && source /etc/autotimeset/timesetcustomscript2 + log "CustomScript succeeded!" + ;; + upwifi) + ifconfig wlan0 up + uci set wireless.radio0.disabled=0 + uci set wireless.radio1.disabled=0 + uci commit wireless + wifi up + ;; + downwifi) + ifconfig wlan0 down + uci set wireless.radio0.disabled=1 + uci set wireless.radio1.disabled=1 + uci commit wireless + wifi down + ;; esac } diff --git a/luci-app-autotimeset/root/usr/bin/timesetsecurity b/luci-app-autotimeset/root/usr/bin/timesetsecurity deleted file mode 100644 index ae139978..00000000 --- a/luci-app-autotimeset/root/usr/bin/timesetsecurity +++ /dev/null @@ -1,119 +0,0 @@ -#! /bin/bash - -#ԴĴ -tryErrNum=10 -#Դڶ೤ʱ䷶Χλ룬tryErrNumһЧ -tryTimeOut=300 -#ҪĶipַŸ,Ϊ -dropIpList="" -#logreadʶַBad password attempt for ssh root¼logluci: failed login on ǵ¼weblog -errStr=("Bad password attempt for" "luci: failed login on") -#ѯlogread ־ʱ,λ -timesleep=30 - -#Ӹַ־ȡҪip׷ӵ dropIpList -getdropip() { - #Թ˵־ - lines=$(logread | grep $1 | sed -n '1!G;h;$p') - linesNum=$(echo -n "$lines" | wc -l) - #ֵ - declare -A dict - # - if [ "$linesNum" -gt "$tryErrNum" ];then - while read line; - do - ip=$(echo -n "$line" | awk '{print $NF}' | awk -F":" '{print $1}') - time=$(echo -n "$line" | awk '{print $4}' | awk -F":" '{sum += $1*3600 + $2*60 + $3};END {print sum}') - ok=${dict[$ip]} - if [ -z $ok ];then - dict[$ip]=1 - time=$(date | awk '{print $4}' | awk -F":" '{sum += $1*3600 + $2*60+ $3};END {print sum}') - dict[${ip}_endtime]=$time - else - if [ ${dict[$ip]} -lt "$tryErrNum" ];then - dict[$ip]=$(expr ${dict[$ip]} + 1) - dict[${ip}_starttime]=$time - fi - fi - done < <(echo -n "$lines") - - for key in ${!dict[@]}; - do - if ! [[ "$key" =~ "starttime" ]] && ! [[ "$key" =~ "endtime" ]];then - if [ ${dict[$key]} -eq "$tryErrNum" ];then - timeDiff=$(expr ${dict[${key}_endtime]} - ${dict[${key}_starttime]}) - if [ "$timeDiff" -gt 0 ] && [ "$timeDiff" -lt "$tryTimeOut" ];then - #׷Ҫip - dropIpList=$dropIpList,$key - fi - fi - fi - done - - fi - -} - -#errStr ֱַlogƥ䣬ȡҪip -startGetDropIp(){ - i=0 - while : - do - errstr=${errStr[$i]} - if [ -z "$errstr" ];then - break - fi - i=$(expr $i + 1) - - getdropip $errstr - - done -} - -#ʼipset iptable -intEnv(){ - ipset list BlockIpList - if ! [ "$?" == 0 ]; - then - ipset create BlockIpList hash:net timeout 300 - iptables -I INPUT -m set --match-set BlockIpList src -p tcp -m tcp --dport 22 -j DROP - iptables -I INPUT -m set --match-set BlockIpList src -p tcp -m tcp --dport 80 -j DROP - iptables -I INPUT -s 192.168.0.0/16 -j ACCEPT - fi -} -#Ҫipӵipset BlockIpList -ipsetAddIp(){ - dropIpListNew="" - for ip in $(echo -n "$dropIpList" | sed 's/,/ /g') - do - ipset add BlockIpList $ip - if [ "$?" -eq 0 ];then - dropIpListNew=$dropIpListNew,$ip - fi - done -} - -sendlogger(){ - if [ -n "$dropIpListNew" ];then - echo -e "autotimeset:MyOpenwrt IP:$dropIpListNew" - logger -p warn -t "autotimeset" ",ʱ: IP:$dropIpListNew ---- ʱ䣺`date `" - fi -} - -#鵱ǰǷ -PocessNum=$(ps | grep timesetsecurity | grep -v grep | wc -l) -if [ "$PocessNum" -gt 2 ];then - #Ѿڽֱ̣˳ǰ - kill -9 $$ -else - intEnv - - while : - do - sleep $timesleep - dropIpList="" - startGetDropIp - ipsetAddIp - sendlogger - done -fi diff --git a/luci-app-netspeedtest/Makefile b/luci-app-netspeedtest/Makefile index 81487e5b..8ab2d223 100644 --- a/luci-app-netspeedtest/Makefile +++ b/luci-app-netspeedtest/Makefile @@ -1,4 +1,4 @@ -# + # Copyright (C) 2020-2021 sirpdboy # # This is free software, licensed under the GNU General Public License v3. @@ -8,11 +8,11 @@ include $(TOPDIR)/rules.mk PKG_NAME:=luci-app-netspeedtest -PKG_VERSION:=2.2.1 -PKG_RELEASE:=20240307 +PKG_VERSION:=2.2.2 +PKG_RELEASE:=20240311 LUCI_TITLE:=LuCI Support for netspeedtest -LUCI_DEPENDS:=+python3 +iperf3-ssl +homebox +ca-certificates +LUCI_DEPENDS:=+python3 +iperf3-ssl +homebox LUCI_PKGARCH:=all PKG_MAINTAINER:= diff --git a/luci-app-netspeedtest/luasrc/model/cbi/netspeedtest/speedtestiperf3.lua b/luci-app-netspeedtest/luasrc/model/cbi/netspeedtest/speedtestiperf3.lua index bed70304..212ca5a8 100644 --- a/luci-app-netspeedtest/luasrc/model/cbi/netspeedtest/speedtestiperf3.lua +++ b/luci-app-netspeedtest/luasrc/model/cbi/netspeedtest/speedtestiperf3.lua @@ -6,7 +6,7 @@ local o,s,e o = Map("netspeedtest", "" .. translate("Net Speedtest") .."",translate( "Network speed diagnosis test (including intranet and extranet)
For specific usage, see:") ..translate("GitHub @sirpdboy/netspeedtest") ) o:section(SimpleSection).template = "netspeedtest/speedtestiperf3_status" -s = o:section(TypedSection, "netspeedtest", translate('Lan Speedtest Iperf3')) +s = o:section(TypedSection, "speedtestiperf3", translate('Lan Speedtest Iperf3')) s.addremove=false s.anonymous=true diff --git a/luci-app-netspeedtest/luasrc/model/cbi/netspeedtest/speedtestlan.lua b/luci-app-netspeedtest/luasrc/model/cbi/netspeedtest/speedtestlan.lua index 77f0c484..e2e7c50b 100644 --- a/luci-app-netspeedtest/luasrc/model/cbi/netspeedtest/speedtestlan.lua +++ b/luci-app-netspeedtest/luasrc/model/cbi/netspeedtest/speedtestlan.lua @@ -6,7 +6,7 @@ m = Map("netspeedtest", "" .. translate("Net Speedtest") .." s = m:section(TypedSection, "netspeedtest", translate('Lan Speedtest Web')) s.anonymous = true -o=s:option(Flag,"enabled",translate("Enable")) +o=s:option(Flag,"enabled",translate("Enable Homebox service")) o.default=0 o = s:option(DummyValue, '', '') diff --git a/luci-app-netspeedtest/luasrc/model/cbi/netspeedtest/speedtestwan.lua b/luci-app-netspeedtest/luasrc/model/cbi/netspeedtest/speedtestwan.lua index 7ccfc718..34962a96 100644 --- a/luci-app-netspeedtest/luasrc/model/cbi/netspeedtest/speedtestwan.lua +++ b/luci-app-netspeedtest/luasrc/model/cbi/netspeedtest/speedtestwan.lua @@ -7,6 +7,11 @@ o = Map("netspeedtest", "" .. translate("Net Speedtest") .." t=o:section(TypedSection,"speedtestwan",translate("Broadband speed test")) t.anonymous=true +e = t:option(ListValue, 'speedtest_cli', translate('client version selection')) +e:value("0",translate("ookla-speedtest-cli")) +e:value("1",translate("python3-speedtest-cli")) +e.default = "1" + e = t:option(DummyValue, '', '') e.rawhtml = true e.template ='netspeedtest/speedtestwan' diff --git a/luci-app-netspeedtest/luasrc/view/netspeedtest/speedtestiperf3.htm b/luci-app-netspeedtest/luasrc/view/netspeedtest/speedtestiperf3.htm index 3bc196a8..853612e5 100644 --- a/luci-app-netspeedtest/luasrc/view/netspeedtest/speedtestiperf3.htm +++ b/luci-app-netspeedtest/luasrc/view/netspeedtest/speedtestiperf3.htm @@ -72,7 +72,7 @@
- <%:-c, --client ..............run in client mode, connecting to %>
+ <%:-c, --client host ................run in client mode, connecting to host%>
<%:-s, --server .....................run in server mode%>
<%:-u, --udp ........................use UDP rather than TCP%>
<%:-b, --bandwidth ..[KMG]...target bandwidth in bits/sec (0 for unlimited)%>
diff --git a/luci-app-netspeedtest/luasrc/view/netspeedtest/speedtestwan.htm b/luci-app-netspeedtest/luasrc/view/netspeedtest/speedtestwan.htm index e4d4b803..7da4bb3e 100644 --- a/luci-app-netspeedtest/luasrc/view/netspeedtest/speedtestwan.htm +++ b/luci-app-netspeedtest/luasrc/view/netspeedtest/speedtestwan.htm @@ -17,21 +17,51 @@