0%

将KoolProxyR规则转换为KoolProxy规则脚本

离线安装

SSH到路由器上
下载KoolProxy离线包

1
2
cd /tmp
weget http://cdn.jakehu.me/koolproxy.tar.gz

解压并安装

1
2
tar koolproxy.tar.gz
sh koolproxy/install.sh

规则转换

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
安装WebShell
复制下面的内容发送命令。

cd /jffs/.koolshare/koolproxy/data/rules
# 删除旧版本规则文件
rm -rf koolproxy.txt
rm -rf daily.txt
rm -rf kp.dat
# 下载新版本规则文件

wget -O daily.txt https://raw.githubusercontent.com/user1121114685/koolproxyR/master/koolproxyR/koolproxyR/data/rules/easylistchina.txt
wget -O koolproxy.txt https://raw.githubusercontent.com/user1121114685/koolproxyR/master/koolproxyR/koolproxyR/data/rules/fanboy-annoyance.txt
# wget -O kp.dat https://raw.githubusercontent.com/user1121114685/koolproxyR/master/koolproxyR/koolproxyR/data/rules/kp.dat
wget -O kp.dat https://raw.githubusercontent.com/user1121114685/koolproxyR_rule_list/master/kp.dat
# wget -O user.txt https://raw.githubusercontent.com/user1121114685/koolproxyR/master/koolproxyR/koolproxyR/data/rules/user.txt
wget -O user.txt https://raw.githubusercontent.com/user1121114685/koolproxyR_rule_list/master/kpr_our_rule.txt
# 下载扩展规则合并
wget -O koolproxy_tmp.txt https://raw.githubusercontent.com/user1121114685/koolproxyR/191c06c8d1f769f1b81c1437ad3b1271e0e58d7b/koolproxyR/koolproxyR/data/rules/kpr_video_list.txt
wget -O daily_tmp.txt https://raw.githubusercontent.com/user1121114685/koolproxyR/master/koolproxyR/koolproxyR/data/rules/yhosts.txt

cat koolproxy_tmp.txt >>koolproxy.txt
cat daily_tmp.txt >>daily.txt

echo 一点点清洁工作...
rm -rf koolproxy_tmp.txt
rm -rf daily_tmp.txt
echo koolproxy规则已替换完成,请重新启用koolproxy!

自动更新

脚本

自动更新脚本如下:
/jffs/scripts/koolproxy.sh

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#!/bin/sh

echo "开始转换koolproxyR规则"
cd /jffs/.koolshare/koolproxy/data/rules

# 删除旧版本规则文件
echo "第一步"
echo
echo -e "删除旧版本规则文件"
rm -rf koolproxy.txt
rm -rf daily.txt
rm -rf kp.dat

# 下载新版本规则文件
echo "第二步"
echo
echo -e "下载新版本规则文件"
wget -O daily.txt https://raw.githubusercontent.com/user1121114685/koolproxyR/master/koolproxyR/koolproxyR/data/rules/easylistchina.txt
wget -O koolproxy.txt https://raw.githubusercontent.com/user1121114685/koolproxyR/master/koolproxyR/koolproxyR/data/rules/fanboy-annoyance.txt
# wget -O kp.dat https://raw.githubusercontent.com/user1121114685/koolproxyR/master/koolproxyR/koolproxyR/data/rules/kp.dat
wget -O kp.dat https://raw.githubusercontent.com/user1121114685/koolproxyR_rule_list/master/kp.dat
# wget -O user.txt https://raw.githubusercontent.com/user1121114685/koolproxyR/master/koolproxyR/koolproxyR/data/rules/user.txt
wget -O user.txt https://raw.githubusercontent.com/user1121114685/koolproxyR_rule_list/master/kpr_our_rule.txt
# 下载扩展规则合并
wget -O koolproxy_tmp.txt https://raw.githubusercontent.com/user1121114685/koolproxyR/191c06c8d1f769f1b81c1437ad3b1271e0e58d7b/koolproxyR/koolproxyR/data/rules/kpr_video_list.txt
wget -O daily_tmp.txt https://raw.githubusercontent.com/user1121114685/koolproxyR/master/koolproxyR/koolproxyR/data/rules/yhosts.txt

echo "第三步"
echo
echo -e "合并规则"
cat koolproxy_tmp.txt >>koolproxy.txt
cat daily_tmp.txt >>daily.txt

echo "第四步"
echo
echo -e "一点点清洁工作..."
rm -rf koolproxy_tmp.txt
rm -rf daily_tmp.txt
echo -e "koolproxyR规则转换成功"

exit 0

设置

1
Tools->Scripts->定时任务
我就想试试,没别的意思!