mirror of
https://github.com/kenzok8/small-package
synced 2025-01-08 13:27:36 +08:00
update 2023-01-16 08:46:26
This commit is contained in:
parent
30ece8b202
commit
3d07572ed5
@ -123,15 +123,15 @@ function to_check()
|
||||
elseif board_name:match("redmi,ax6$") then
|
||||
model = "ipq807x_generic/redmi_ax6"
|
||||
check_update()
|
||||
download_url = "https://op.supes.top/firmware/" ..model.. "/" ..remote_version.. "-openwrt-ipq807x-generic-redmi_ax6-squashfs-nand-sysupgrade.bin"
|
||||
download_url = "https://op.supes.top/firmware/" ..model.. "/" ..remote_version.. "-openwrt-ipq807x-generic-redmi_ax6-squashfs-sysupgrade.bin"
|
||||
elseif board_name:match("xiaomi,ax9000$") then
|
||||
model = "ipq807x_generic/xiaomi_ax9000"
|
||||
check_update()
|
||||
download_url = "https://op.supes.top/firmware/" ..model.. "/" ..remote_version.. "-openwrt-ipq807x-generic-xiaomi_ax9000-squashfs-nand-sysupgrade.bin"
|
||||
download_url = "https://op.supes.top/firmware/" ..model.. "/" ..remote_version.. "-openwrt-ipq807x-generic-xiaomi_ax9000-squashfs-sysupgrade.bin"
|
||||
elseif board_name:match("xiaomi,ax3600$") then
|
||||
model = "ipq807x_generic/xiaomi_ax3600"
|
||||
check_update()
|
||||
download_url = "https://op.supes.top/firmware/" ..model.. "/" ..remote_version.. "-openwrt-ipq807x-generic-xiaomi_ax3600-squashfs-nand-sysupgrade.bin"
|
||||
download_url = "https://op.supes.top/firmware/" ..model.. "/" ..remote_version.. "-openwrt-ipq807x-generic-xiaomi_ax3600-squashfs-sysupgrade.bin"
|
||||
elseif board_name:match("xy%-c5$") then
|
||||
model = "ramips_mt7621/xiaoyu_xy-c5"
|
||||
check_update()
|
||||
|
@ -8,7 +8,7 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=lucky
|
||||
PKG_VERSION:=1.7.5
|
||||
PKG_VERSION:=1.7.13
|
||||
PKG_RELEASE:=1
|
||||
PKGARCH:=all
|
||||
|
||||
|
10
luci-app-netspeedtest/etc/config/netspeedtest
Normal file
10
luci-app-netspeedtest/etc/config/netspeedtest
Normal file
@ -0,0 +1,10 @@
|
||||
config homebox 'homebox'
|
||||
option enabled '0'
|
||||
option port '3300'
|
||||
option logger '1'
|
||||
|
||||
config speedtestiperf3 'speedtestiperf3'
|
||||
option enabled '0'
|
||||
|
||||
config wanspeedtest 'wanspeedtest'
|
||||
option surl ' '
|
84
luci-app-netspeedtest/etc/init.d/netspeedtest
Normal file
84
luci-app-netspeedtest/etc/init.d/netspeedtest
Normal file
@ -0,0 +1,84 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
|
||||
#
|
||||
# Copyright (C) 2020-2022 sirpdboy <herboy2008@gmail.com> https://github.com/sirpdboy/netspeedtest
|
||||
|
||||
# This is free software, licensed under the Apache License, Version 2.0 .
|
||||
#
|
||||
|
||||
START=99
|
||||
USE_PROCD=1
|
||||
|
||||
|
||||
PROG=/usr/bin/homebox
|
||||
EXTRA_COMMANDS="nstest"
|
||||
|
||||
TMP_T=/var/netspeedtest.tmp
|
||||
LOCK=/var/lock/netspeedtest.lock
|
||||
LOG=/var/log/netspeedtest.log
|
||||
|
||||
limit_log() {
|
||||
local logf=$1
|
||||
[ ! -f "$logf" ] && return
|
||||
local sc=100
|
||||
[ -n "$2" ] && sc=$2
|
||||
local count=$(grep -c "" $logf)
|
||||
if [ $count -gt $sc ];then
|
||||
let count=count-$sc
|
||||
sed -i "1,$count d" $logf
|
||||
fi
|
||||
}
|
||||
|
||||
init_env() {
|
||||
[ ! -f "$LOG" ] && echo "" > $LOG
|
||||
echo 1 > $TMP_T
|
||||
|
||||
}
|
||||
|
||||
nstest() {
|
||||
[ -f $LOCK ] && exit
|
||||
limit_log $LOG 200
|
||||
init_env
|
||||
touch $LOCK
|
||||
|
||||
echo -ne "\n speedtest测速" | tee -a $LOG
|
||||
/usr/bin/speedtest --share > $TMP_T
|
||||
echo -ne "\n 测服信息:$(cat $TMP_T | grep 'Hosted by'| cut -c10- | awk -F: '{printf $1}') 延时:$(cat $TMP_T | grep 'Hosted by' | awk -F: '{printf $2}')" >> $LOG
|
||||
echo -ne "\n 下行速率:$(cat $TMP_T | grep 'Download:' |awk -F: '{printf $2}' )" >> $LOG
|
||||
echo -ne " ---- 上行速率:$(cat $TMP_T | grep 'Upload:' |awk -F: '{printf $2}' )" >> $LOG
|
||||
echo -ne "\n 测试时间: " >> $LOG
|
||||
echo $(date +%Y-%m-%d" "%H:%M:%S) >> $LOG
|
||||
echo -ne " ————————————————————————————\n" >> $LOG
|
||||
echo -ne $(cat $TMP_T | grep 'results:' | cut -c16- )
|
||||
rm -f $LOCK
|
||||
}
|
||||
|
||||
get_config() {
|
||||
config_get_bool enabled $1 enabled 1
|
||||
config_get_bool logger $1 logger 1
|
||||
}
|
||||
|
||||
homebox_prepare() {
|
||||
pgrep -f homebox | xargs kill -9 >/dev/null 2>&1
|
||||
}
|
||||
|
||||
stop_service() {
|
||||
homebox_prepare
|
||||
}
|
||||
|
||||
start_service() {
|
||||
homebox_prepare
|
||||
config_load netspeedtest
|
||||
config_foreach get_config homebox
|
||||
[ "x$enabled" != "x1" ] && exit 1
|
||||
procd_open_instance
|
||||
procd_set_param command $PROG
|
||||
[ "x$logger" == x1 ] && procd_set_param stderr 1
|
||||
procd_set_param respawn
|
||||
procd_close_instance
|
||||
}
|
||||
|
||||
service_triggers() {
|
||||
procd_add_reload_trigger "netspeedtest"
|
||||
}
|
||||
|
@ -0,0 +1,5 @@
|
||||
#!/bin/sh
|
||||
chmod +x /etc/init.d/netspeedtest /usr/bin/*test >/dev/null 2>&1
|
||||
|
||||
rm -rf /tmp/luci-modulecache /tmp/luci-indexcache*
|
||||
exit 0
|
Loading…
Reference in New Issue
Block a user