推荐当贝市场

 找回密码
 立即注册

QQ登录

只需一步,快速开始

查看: 28094|回复: 7

[求助] 哪个大神有中兴B860av2.1双线自动切换脚本!先谢过了

[复制链接]
发表于 2017-2-27 17:58 | 显示全部楼层 |阅读模式
#!/system/bin/sh

appid="8"

time_count=0
while [ 1 ]

do

        time_count=`expr $time_count + 0.5`

        check_app=$( dumpsys window w | grep -E com.zte.browser | grep / | busybox wc -l )

        

        if [ "$check_app" -ge $appid ] ; then

                ifconfig eth0:1 down

                ifconfig eth0 up

        fi

        

        if [ "$check_app" -lt $appid ] ; then

                ifconfig eth0:1 up

                ifconfig eth0 down

        fi

        

        sleep 0.5

        

        if [ $time_count -gt 181 ] ; then

                exit 0

        fi

        

done
 楼主| 发表于 2017-2-27 17:59 | 显示全部楼层
#!/system/bin/sh


routeip="192.168.1.11"

routegw="192.168.1.1"

routenet="192.168.1.0"

routemask="255.255.255.0"

tvgw="10.230.0.1"

appid="7"


time_count=0

while [ 1 ]

do

        time_count=`expr $time_count + 0.5`

        check_app=$( dumpsys window w | grep -E com.zte.browser | grep / | busybox wc -l )

        

        if [ "$check_app" -ge $appid ] ; then

                ifconfig eth0:1 $routeip netmask $routemask down

                route del -net $routenet netmask $routemask

                route del default gw $routegw

                route add default gw $tvgw

        fi

        

        if [ "$check_app" -lt $appid ] ; then

                ifconfig eth0:1 $routeip netmask $routemask up

                route add -net $routenet netmask $routemask gw $routegw

                route add default gw $routegw

                route del default gw $tvgw

        fi

        

        sleep 0.5

        

        if [ $time_count -gt 181 ] ; then

                exit 0

        fi

        

done
回复 顶一个 踩

使用道具 举报

 楼主| 发表于 2017-2-27 18:00 | 显示全部楼层
用这个脚本连接网不能改变IP
回复 顶一个 踩

使用道具 举报

 楼主| 发表于 2017-2-27 18:01 | 显示全部楼层
一米阳光大神看到给个脚本。谢谢了。等级太低不能给你打招呼
回复 顶一个 踩

使用道具 举报

发表于 2017-2-27 19:01 | 显示全部楼层
http://www.znds.com/tv-566144-1-1.html可以参考一下这个
回复 顶一个 踩

使用道具 举报

发表于 2017-2-27 19:32 | 显示全部楼层
http://www.znds.com/tv-579100-1-1.html 看看这个有没有用
回复 顶一个 踩

使用道具 举报

 楼主| 发表于 2017-3-1 16:55 来自ZNDS手机版 | 显示全部楼层
都不行
回复 顶一个 踩

使用道具 举报

发表于 2017-4-15 21:05 | 显示全部楼层
#!/system/bin/sh  routeip="192.168.1.2" routegw="192.168.1.1" routenet="192.168.1.0" routemask="255.255.255.0" tvgw="10.1.1.1" appid="8"  time_count=0 while [ 1 ] do         time_count=`expr $time_count + 0.5`         check_app=$( dumpsys window w | grep -E com.zte.browser | grep / | busybox wc -l )                  if [ "$check_app" -ge $appid ] ; then                 ifconfig eth0:1 $routeip netmask $routemask down                 route del -net $routenet netmask $routemask                 route del default gw $routegw                 route add default gw $tvgw         fi                  if [ "$check_app" -lt $appid ] ; then                 ifconfig eth0:1 $routeip netmask $routemask up                 route add -net $routenet netmask $routemask gw $routegw                 route add default gw $routegw                 route del default gw $tvgw         fi                  sleep 0.5                  if [ $time_count -gt 181 ] ; then                 exit 0         fi          done
回复 顶一个 踩

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

关闭

站长推荐上一条 /2 下一条

Archiver|小黑屋|新帖|标签|软件|Sitemap|ZNDS智能电视网 ( 苏ICP备2023012627号 )

GMT+8, 2026-11-9 04:34 , Processed in 0.029008 second(s), 7 queries , Redis On.

Powered by Discuz! X3.5

© 2001-2026 Discuz! Team.

快速回复 返回顶部 返回列表