电信带宽稳定提速工具

作者 : King 本文共5441个字,预计阅读时间需要14分钟 发布时间: 2024-10-4 共14人阅读

电信带宽提速

电信带宽稳定提速工具

工具下载:电信带宽提速

脚本:Sh27_speedup.sh

可提速到500M带宽。

1、获取token。

获取方法:打开软件,输入手机号获取验证码,然后知识兔登录账号,启动提速。

这时应用根目录下会生成一个文件token,知识兔使用文本方式打开

电信带宽稳定提速工具

2、以K2P子固件为例。用winscp登录路由器,导入speedup代码
导入目录:etc/storage/script下。文件名命名为:Sh27_speedup.sh

电信带宽稳定提速工具

电信带宽稳定提速工具

3、重启路由器,然后知识兔再登录路由器。进入扩展功能-搭建web环境-家庭云提速
再填入第一步获取的token。保存应用。

电信带宽稳定提速工具

4、再重启路由进日志查看,提速成功有显示。理论永久可提速,第一小时自动运行一次代码。

电信带宽稳定提速工具

 

 

speedup代码

#!/bin/sh#copyright by hiboysource /etc/storage/script/init.shspeedup_path="/opt/app/speedup/speedup"speedup_enable=`nvram get app_10`[ -z $speedup_enable ] && speedup_enable=0 && nvram set app_10=0if [ "$speedup_enable" != "0" ] ; thenspeedup_enable=`nvram get app_10`[ -z $speedup_enable ] && speedup_enable=0 && nvram set app_10=0speedup_Info=`nvram get app_11`[ -z "$speedup_Info" ] && speedup_Info=1 && nvram set app_11=1AccessToken=`nvram get app_12`[ -z "$AccessToken" ] && AccessToken="" && nvram set app_12=""Start_Qos=`nvram get app_13`[ -z "$Start_Qos" ] && Start_Qos="" && nvram set app_13=""Heart_Qos=`nvram get app_17`[ -z "$Heart_Qos" ] && Heart_Qos="" && nvram set app_17=""Info="$speedup_Info"[ -z "$Info" ] && Info=1qosClientSn="$(cat /proc/sys/kernel/random/uuid)"ln -sf /etc/storage/script/Sh27_speedup.sh /opt/app/speedup/speedupchmod 777 /opt/app/speedup/speedupspeedup_renum=`nvram get speedup_renum`STATUS="N"SN=""fiif [ ! -z "$(echo $scriptfilepath | grep -v "/tmp/script/" | grep speedup)" ] && [ ! -s /tmp/script/_app4 ]; then mkdir -p /tmp/script { echo '#!/bin/sh' ; echo $scriptfilepath '"$@"' '&' ; } > /tmp/script/_app4 chmod 777 /tmp/script/_app4fispeedup_restart () {relock="/var/lock/speedup_restart.lock"if [ "$1" = "o" ] ; then nvram set speedup_renum="0" [ -f $relock ] && rm -f $relock return 0fiif [ "$1" = "x" ] ; then if [ -f $relock ] ; then logger -t "【speedup】" "多次尝试启动失败,等待【"`cat $relock`"分钟】后自动尝试重新启动" exit 0 fi speedup_renum=${speedup_renum:-"0"} speedup_renum=`expr $speedup_renum + 1` nvram set speedup_renum="$speedup_renum" if [ "$speedup_renum" -gt "2" ] ; then I=19 echo $I > $relock logger -t "【speedup】" "多次尝试启动失败,等待【"`cat $relock`"分钟】后自动尝试重新启动" while [ $I -gt 0 ]; do I=$(($I - 1)) echo $I > $relock sleep 60 [ "$(nvram get speedup_renum)" = "0" ] && exit 0 [ $I -lt 0 ] && break done nvram set speedup_renum="0" fi [ -f $relock ] && rm -f $relockfinvram set speedup_status=0eval "$scriptfilepath &"exit 0}speedup_get_status () {A_restart=`nvram get speedup_status`B_restart="$speedup_enable$speedup_Info$AccessToken"B_restart=`echo -n "$B_restart" | md5sum | sed s/[[:space:]]//g | sed s/-//g`if [ "$A_restart" != "$B_restart" ] ; then nvram set speedup_status=$B_restart needed_restart=1else needed_restart=0fi}speedup_check () {speedup_get_statusif [ "$speedup_enable" != "1" ] && [ "$needed_restart" = "1" ] ; then [ ! -z "$(ps -w | grep "$speedup_path" | grep -v grep )" ] && logger -t "【speedup】" "停止 speedup" && speedup_close { eval $(ps -w | grep "$scriptname" | grep -v grep | awk '{print "kill "$1";";}'); exit 0; }fiif [ "$speedup_enable" = "1" ] ; then if [ "$needed_restart" = "1" ] ; then speedup_close speedup_start else [ -z "$(ps -w | grep "$speedup_path" | grep -v grep )" ] && speedup_restart fifi}speedup_keep () {logger -t "【speedup】" "守护进程启动"sleep 60speedup_enable=`nvram get app_10` #speedup_enablei=1while [ "$speedup_enable" = "1" ]; do NUM=`ps -w | grep "$speedup_path" | grep -v grep |wc -l` if [ "$NUM" -lt "1" ] || [ ! -s "$speedup_path" ] || [ "$i" -ge 369 ] ; then logger -t "【speedup】" "重新启动$NUM" speedup_restart fisleep 69i=$((i+1))speedup_enable=`nvram get speedup_enable` #speedup_enabledone}speedup_close () {sed -Ei '/【speedup】|^$/d' /tmp/script/_opt_script_checkkillall speedupkillall -9 speedupkill_ps "speedup start_path"kill_ps "/tmp/script/_app4"kill_ps "_speedup.sh"kill_ps "$scriptname"}speedup_start () {curltest=`which curl`if [ -z "$curltest" ] || [ ! -s "`which curl`" ] ; then logger -t "【speedup】" "找不到 curl ,安装 opt 程序" /tmp/script/_mountopt optwget #initopt curltest=`which curl` if [ -z "$curltest" ] || [ ! -s "`which curl`" ] ; then logger -t "【speedup】" "找不到 curl ,需要手动安装 opt 后输入[opkg install curl]安装" logger -t "【speedup】" "启动失败, 10 秒后自动尝试重新启动" && sleep 10 && speedup_restart x else speedup_restart o fifiupdate_appspeedup_vv=2019-05-25speedup_v=$(grep 'speedup_vv=' /etc/storage/script/Sh27_speedup.sh | grep -v 'speedup_v=' | awk -F '=' '{print $2;}')nvram set speedup_v="$speedup_v"logger -t "【speedup】" "AccessToken $AccessToken"ln -sf /etc/storage/script/Sh27_speedup.sh /opt/app/speedup/speedupchmod 777 /opt/app/speedup/speedupeval "$speedup_path" start_path &sleep 2[ -z "$(ps -w | grep "/opt/app/speedup/speedup" | grep -v grep )" ] && logger -t "【speedup】" "启动成功 $speedup_v " && speedup_restart ospeedup_get_statuseval "$scriptfilepath keep &"exit 0}speedup_start_path () {[ -z "$SN" ] && SN=0speedup_enable=`nvram get app_10`[ -z $speedup_enable ] && speedup_enable=0 && nvram set speedup_enable=0while [[ "$speedup_enable" != 0 ]] do if [ "$SN"x == "0"x ] || [ -z "$SN" ]; then logger -t "【speedup】" "Start_SN is $SN, need to Speedup now" get_session && QOS_Check && QOS_Start if [[ -z "$SN" ]]; then logger -t "【speedup】" "Start_ERROR!!!" else logger -t "【speedup】" "Start Speedup, SN: $SN" sleep 597 fi fi if [[ ! -z "$SN" ]]; then QOS_Start logger -t "【speedup】" "Keep Speedup, SN: $SN" sleep 597 fi speedup_enable=`nvram get speedup_enable` [ -z $speedup_enable ] && speedup_enable=0 && nvram set speedup_enable=0done}hashHmac() { digest="$1" data="$2" key="$3" echo -n "$data" | openssl dgst "-$digest" -hmac "$key" | sed -e 's/^.* //' | tr 'a-z' 'A-Z'}get_session(){GMT_Date="$(date -u '+%a, %d %b %Y %T GMT')"data="AppKey=600100885&Operate="GET"&RequestURI=/family/manage/loginFamily.action&Timestamp=$GMT_Date"key="fe5734c74c2f96a38157f420b32dc995"Check_Signature=`hashHmac "sha1" "$data" "$key"`speedup_login="curl -s --connect-timeout 15 -m 15 http://api.cloud.189.cn/family/manage/loginFamily.action?e189AccessToken=""$AccessToken"" -H 'AppKey:600100885' -H 'AppSignature: ""$Check_Signature""' -H 'Timestamp: ""$GMT_Date""' -H 'User-Agent:Apache-HttpClient/UNAVAILABLE(java1.4)'"re_STAT="$(eval "$speedup_login" | grep userSession)"session_Key="$(echo "$re_STAT" | grep -Eo "sessionKey>.*//' )"session_Secret="$(echo "$re_STAT" | grep -Eo "sessionSecret>.*//' | sed 's/<\/sessionSecret//' )"}get_info(){dial_Account="$(echo "$re_STAT" | awk -F"\|\<\/dialAccount\>" '{if($2!="") print $2}')"target_DownRate="$(echo "$re_STAT" | awk -F"\|\<\/targetDownRate\>" '{if($2!="") print $2}')"DownRate=$(($target_DownRate/1024))target_UpRate="$(echo "$re_STAT" | awk -F"\|\<\/targetUpRate\>" '{if($2!="") print $2}')"UpRate=$(($target_UpRate/1024))logger -t "【speedup】" "宽带账号【$dial_Account】 下行速率【$DownRate"M"】 上行速率【$UpRate"M"】"}QOS_Check(){GMT_Date="$(date -u '+%a, %d %b %Y %T GMT')"ACCESS_URL="/speed/checkSpeedAbilityV2.action"data="SessionKey=$session_Key&Operate="GET"&RequestURI=$ACCESS_URL&Date=$GMT_Date"key="$session_Secret"Check_Signature=`hashHmac "sha1" "$data" "$key"`Check_Qos="curl -s --connect-timeout 15 -m 15 http://api.cloud.189.cn/speed/checkSpeedAbilityV2.action?qosClientSn=""$qosClientSn"" -H 'SessionKey:""$session_Key""' -H 'Signature: ""$Check_Signature""' -H 'Date: ""$GMT_Date""' -H 'User-Agent:Apache-HttpClient/UNAVAILABLE(java1.4)'" re_STAT="$(eval "$Check_Qos" | grep qosCheckResponse)"get_infosleep 3}QOS_Start(){GMT_Date="$(date -u '+%a, %d %b %Y %T GMT')"ACCESS_URL="/speed/startSpeedV2.action"data="SessionKey=$session_Key&Operate="GET"&RequestURI=$ACCESS_URL&Date=$GMT_Date"key="$session_Secret"Start_Signature=`hashHmac "sha1" "$data" "$key"`Start_Qos="curl -s --connect-timeout 15 -m 15 http://api.cloud.189.cn/speed/startSpeedV2.action?qosClientSn=""$qosClientSn"" -H 'SessionKey:""$session_Key""' -H 'Signature: ""$Start_Signature""' -H 'Date: ""$GMT_Date""' -H 'User-Agent:Apache-HttpClient/UNAVAILABLE(java1.4)'"SN_STAT="$(eval "$Start_Qos" | grep qosInfoResponse)"SN="$(echo "$SN_STAT" | awk -F"\|\<\/qosSn\>" '{if($2!="") print $2}')"sleep 3}case $ACTION instart) nvram set speedup_status=0 speedup_close speedup_check ;;check) speedup_check ;;stop) speedup_close ;;keep) #speedup_check speedup_keep ;;start_path) speedup_start_path ;;*) speedup_check ;;esac

 

下载仅供下载体验和测试学习,不得商用和正当使用。

[ppwp passwords=”zhishitu.cn”]

下载体验

应版权要求,禁止分享,敬请谅解,有问题务必找客服哈。

如何获取解压密码

有问题找客服哈,并领取学习福利!

[/ppwp]

点击下载

小鱼网是一个美好的开源学习社区,学习编程,学习WordPress,下载WordPress插件主题,
小鱼网 » 电信带宽稳定提速工具

常见问题FAQ

发表回复

分享最优质的学习资料

立即查看 了解详情