荒野无灯adbyby规则adupdate.sh脚本无法正常更新adbyby-plus规则智能更新
参考kysdm的脚本 修改适配适用于【无灯,HIBOY,LEAN】固件
大雕的adbyby plus:
以下无灯固件示例注意,无灯K2P最新固件改了挂载分区,默认系统日志-Disk Info是挂载4M /etc/storage有问题的重置一次/etc/storage,重启后再操作
PADAVAN智能更新广告过滤 adbyby规则
适用于【无灯,HIBOY,LEAN】固件
1、用WINSCP把脚本放到/etc/storage/adb下,0777权限。
然后系统管理-服务-计划任务: 添加以下命令每天6点定时检测更新
0 6 * * * /etc/storage/adb/adupdate.sh &
2、或者如果设置了每天5点定时重启的,计划任务:
0 5 * * * /sbin/reboot
3、可以在自定义-脚本-WAN口启动联网后,第一时间执行脚本更新规则
logger "运行后 WAN 状态:" "WAN 状态:【$1】, WAN 接口:【$2】, WAN IP:【$3】" if [ $1 == "up" ] ; then sleep 30 /etc/storage/adb/adupdate.sh & fi
4、手动检测更新,系统管理-控制台
sh /etc/storage/adb/adupdate.sh
最后保存一下配置和脚本
保存不了的是你分区满了,格式化一次/etc/storage
adupdate.sh脚本内容如下,自行复制下来新建adupdate.sh文件
#!/bin/sh #kysdm(gxk7231@gmail.com) mod by mj for padavan adbyby tmpdir="/tmp/ad" adbybydir="/etc/storage/adb" logger_title="[Adbyby]" restart_ad(){ /sbin/restart_adbyby } rm_cache(){ rm -rf $tmpdir rm -f $adbybydir/data/*.bak } judge_update(){ if [ "$lazy_online"x == "$lazy_local"x ]; then logger -t "${logger_title}" "本地lazy规则已经最新,无需更新" if [ "$video_online"x == "$video_local"x ]; then logger -t "${logger_title}" "本地video规则已经最新,无需更新" rm_cache && exit 0 else logger -t "${logger_title}" "检测到video规则更新,下载规则中..." download_video;restart_ad rm_cache && exit 0 fi else logger -t "${logger_title}" "检测到lazy规则更新,下载规则中..." if [ "$video_online"x == "$video_local"x ]; then logger -t "${logger_title}" "本地video规则已经最新,无需更新" download_lazy;restart_ad rm_cache && exit 0 else logger -t "${logger_title}" "检测到video规则更新,下载规则中..." download_lazy;download_video;restart_ad rm_cache && exit 0 fi fi } download_lazy(){ wget -q -c -P $tmpdir 'https://raw.githubusercontent.com/adbyby/xwhyc-rules/master/lazy.txt' if [ "$?"x != "0"x ]; then logger -t "${logger_title}" "【lazy】下载coding中的规则失败,尝试下载github中的规则" wget -q -c -P $tmpdir 'https://raw.githubusercontent.com/adbyby/xwhyc-rules/master/lazy.txt' if [ "$?"x != "0"x ]; then logger -t "${logger_title}" "【lazy】双双失败GG,请检查网络" else logger -t "${logger_title}" "【lazy】下载成功,正在应用..." mv $tmpdir/lazy.txt $adbybydir/data/lazy.txt fi else logger -t "${logger_title}" "【lazy】下载成功,正在应用..." mv $tmpdir/lazy.txt $adbybydir/data/lazy.txt fi } download_video(){ wget -q -c -P $tmpdir 'https://raw.githubusercontent.com/adbyby/xwhyc-rules/master/video.txt' if [ "$?"x != "0"x ]; then logger -t "${logger_title}" "【video】下载coding中的规则失败,尝试下载github中的规则" wget -q -c -P $tmpdir 'https://raw.githubusercontent.com/adbyby/xwhyc-rules/master/video.txt' if [ "$?"x != "0"x ]; then logger -t "${logger_title}" "【video】双双失败GG,请检查网络" else logger -t "${logger_title}" "【video】下载成功,正在应用..." mv $tmpdir/video.txt $adbybydir/data/video.txt fi else logger -t "${logger_title}" "【video】下载成功,正在应用..." mv $tmpdir/video.txt $adbybydir/data/video.txt fi } # check_rules() rm_cache mkdir $tmpdir logger -t "${logger_title}" "自动检测规则更新中" && cd $tmpdir md5sum /etc/storage/adb/data/lazy.txt /etc/storage/adb/data/video.txt > local-md5.json wget -q -c -P $tmpdir 'https://raw.githubusercontent.com/adbyby/xwhyc-rules/master/md5.json' if [ "$?"x != "0"x ]; then logger -t "${logger_title}" "获取在线规则时间失败" && exit 0 else lazy_local=$(grep 'lazy' local-md5.json | awk -F' ' '{print $1}') video_local=$(grep 'video' local-md5.json | awk -F' ' '{print $1}') lazy_online=$(sed 's/":"/\n/g' md5.json | sed 's/","/\n/g' | sed -n '2p') video_online=$(sed 's/":"/\n/g' md5.json | sed 's/","/\n/g' | sed -n '4p') logger -t "${logger_title}" "获取在线规则MD5成功,正在判断是否有更新中" #sed -i "s/=video,lazy/=none/g" $adbybydir/adhook.ini #sed -i "s/=video,lazy/=none/g" $adbybydir/adhook.sample.ini judge_update fi exit 0
adbyby-plus规则更新替换adupdate.sh文件
adbyby-plus规则更新全修正备用下载地址:
链接: https://pan.baidu.com/s/1hnkcKaJse3Vh-feNqIzZTg提取码: xcm3
使用方法:
替换/usr/share/adbyby/adupdate.sh
点一下LUCI上高级设置-手动强制更新,会先更新adblock上的hosts,再执行上面脚本更新adbyby规则
可在/tmp/adupdate.log 查看日志
点击链接加入群聊三群:751529538
点击链接加入群聊二群:376877156
点击链接加入群聊【路由器交流群:622891808已满】
本站附件分享,如果附件失效,可以去找找看
饿了么红包
于2020-08-12发布