forked from kiddin9/Kwrt
-
Notifications
You must be signed in to change notification settings - Fork 0
/
default-settings
248 lines (204 loc) · 6.56 KB
/
default-settings
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
#!/bin/sh
ln -sf /sbin/ip /usr/bin/ip
sed -i 's/snapshots\(.*luci\)/releases\/19.07-SNAPSHOT\1/g' /etc/opkg/distfeeds.conf
sed -i '/openwrt_custom/d' /etc/opkg/distfeeds.conf
sed -i 's/http/https/g' /etc/opkg/distfeeds.conf
sed -i "s/# //g" /etc/opkg/distfeeds.conf
sed -i '/log-facility/d' /etc/dnsmasq.conf
echo "log-facility=/dev/null" >> /etc/dnsmasq.conf
sed -i "s/127.0.0.1:5335/127.0.0.1:5555/g" /etc/AdGuardHome.yaml
rm -rf /tmp/luci-*
uci set smartdns.@smartdns[0].ipv6_server='0'
uci commit smartdns
[ $(uci get dhcp.@dnsmasq[0].filter_aaaa 2>/dev/null) ] || {
uci set dhcp.@dnsmasq[0].filter_aaaa='1'
uci commit dhcp
}
if [ ! -f /etc/config/placeholder ]; then
uci set luci.main.lang=zh_cn
uci set luci.main.mediaurlbase=/luci-static/argon
uci commit luci
uci set system.@system[0].timezone=CST-8
uci set system.@system[0].zonename=Asia/Shanghai
uci commit system
uci set fstab.@global[0].anon_mount=1
uci commit fstab
sed -i 's/root:.*/root:$1$tTPCBw1t$ldzfp37h5lSpO9VXk4uUE\/:18336:0:99999:7:::/g' /etc/shadow
uci set network.lan.ipaddr="10.0.0.1"
uci set network.wan.proto=pppoe
uci commit network
sed -i '/ipv6.conf/d' /etc/sysctl.conf
echo net.ipv6.conf.all.disable_ipv6=1 >> /etc/sysctl.conf
echo net.ipv6.conf.default.disable_ipv6=1 >> /etc/sysctl.conf
echo net.ipv6.conf.lo.disable_ipv6 = 1 >> /etc/sysctl.conf
uci del dockerman.local.daemon_ea
uci commit dockerman
uci set firewall.@defaults[0].fullcone='1'
uci commit firewall
uci set flowoffload.@flow[0].bbr='1'
uci commit flowoffload
uci set shadowsocksr.@global[0].pdnsd_enable='0'
uci del shadowsocksr.@global[0].tunnel_forward
uci add_list shadowsocksr.@access_control[0].wan_fw_ips='1.1.1.1'
uci add_list shadowsocksr.@access_control[0].wan_fw_ips='208.67.222.222'
uci add_list shadowsocksr.@access_control[0].wan_fw_ips='8.8.8.8'
uci add_list shadowsocksr.@access_control[0].wan_fw_ips='8.8.4.4'
uci add_list shadowsocksr.@access_control[0].wan_fw_ips='9.9.9.9'
uci add_list shadowsocksr.@access_control[0].wan_fw_ips='218.102.23.228'
uci add_list shadowsocksr.@access_control[0].wan_fw_ips='210.0.255.250'
uci add_list shadowsocksr.@access_control[0].wan_fw_ips='168.95.1.1'
uci add_list shadowsocksr.@access_control[0].wan_fw_ips='202.175.82.46'
uci add_list shadowsocksr.@access_control[0].wan_fw_ips='77.88.8.8'
uci add_list shadowsocksr.@access_control[0].wan_fw_ips='101.101.101.101'
uci add_list shadowsocksr.@access_control[0].wan_fw_ips='203.198.7.66'
uci add_list shadowsocksr.@access_control[0].wan_fw_ips='202.56.128.30'
uci add_list shadowsocksr.@access_control[0].wan_fw_ips='149.112.112.112'
uci commit shadowsocksr
uci set AdGuardHome.AdGuardHome.redirect='dnsmasq-upstream'
uci set AdGuardHome.AdGuardHome.enabled='1'
uci commit AdGuardHome
uci set smartdns.@smartdns[0].enabled='1'
uci set smartdns.@smartdns[0].port='5555'
uci set smartdns.@smartdns[0].redirect='none'
uci set smartdns.@smartdns[0].tcp_server='1'
uci set smartdns.@smartdns[0].prefetch_domain='1'
uci set smartdns.@smartdns[0].serve_expired='1'
uci commit smartdns
uci -q set aria2.main.split="128"
uci -q set aria2.main.min_split_size="100K"
uci -q set aria2.main.max_connection_per_server="128"
uci -q add_list aria2.main.extra_settings="dht-file-path=/usr/share/aria2/dht.dat"
uci commit aria2
[ -f "/etc/config/smartdns" ] && {
cat >> /etc/config/smartdns <<EOF
config server
option name '腾讯'
option type 'udp'
option enabled '1'
option ip '119.29.29.29'
option blacklist_ip '1'
config server
option name '阿里'
option type 'udp'
option enabled '1'
option ip '223.5.5.5'
option blacklist_ip '1'
config server
option name '114'
option type 'tcp'
option enabled '1'
option ip '114.114.114.114'
option blacklist_ip '1'
config server
option name 'Cloudflare'
option ip '1.1.1.1'
option type 'tls'
option enabled '1'
config server
option name 'opendns'
option ip '208.67.222.222'
option port '5353'
option type 'tcp'
option enabled '1'
config server
option name 'google'
option ip 'dns.google'
option type 'tls'
option enabled '1'
config server
option name 'IBM'
option ip 'dns.quad9.net'
option type 'tls'
option enabled '1'
config server
option type 'tcp'
option enabled '1'
option ip '210.0.255.250'
option blacklist_ip '0'
option name '香港环球全域电讯'
config server
option type 'udp'
option name '广州电信'
option ip '202.96.128.86'
option blacklist_ip '1'
option enabled '0'
config server
option name '台湾'
option ip '168.95.1.1'
option type 'tcp'
option enabled '1'
config server
option type 'tcp'
option ip '218.102.23.228'
option blacklist_ip '0'
option name '電訊盈科'
option enabled '0'
config server
option name '澳门'
option ip '202.175.82.46'
option type 'tcp'
option enabled '1'
config server
option name '红鱼'
option ip 'dns.rubyfish.cn'
option type 'tls'
option enabled '1'
option blacklist_ip '1'
config server
option enabled '1'
option name '清华'
option ip '101.6.6.6'
option port '5353'
option type 'tcp'
config server
option enabled '1'
option type 'udp'
option name '百度'
option ip '180.76.76.76'
option blacklist_ip '1'
config server
option enabled '1'
option name 'Yandex'
option ip '77.88.8.8'
option type 'tcp'
config server
option enabled '1'
option name '台湾 Quad101'
option ip '101.101.101.101'
option type 'tls'
config server
option enabled '1'
option name 'HK网上行'
option ip '203.198.7.66'
option type 'tcp'
option blacklist_ip '1'
config server
option enabled '1'
option name '新加坡DNS'
option ip '202.56.128.30'
option type 'tcp'
EOF
}
fi
if [ -f /etc/config/jia ]; then
sed -i '/=\/tmp\/dnsmasq.ssr/d' /etc/init.d/shadowsocksr
sed -i 's/service_start $PROG/service_start $PROG -R/g' /etc/init.d/php7-fpm
sed -i "s/user =.*/user = root/g" /etc/php7-fpm.d/www.conf
fi
if [ ! -f /usr/bin/ssr-server ]; then
sed -i '/server-config/d' /usr/lib/lua/luci/controller/shadowsocksr.lua
fi
find /www -type f -exec chmod 644 {} \;
find /www -type d -exec chmod 755 {} \;
cp -R /www/cgi-bin/* /www/
chmod +x /www/luci
chmod +x /usr/share/aria2/*.sh
ln -sf /usr/bin/python3 /usr/bin/python
ln -sf /usr/lib/netdata/conf.d /etc/netdata/conf.d
ln /usr/lib/netdata/conf.d/charts.d.conf /etc/netdata/charts.d.conf
ln /usr/lib/netdata/conf.d/python.d.conf /etc/netdata/python.d.conf
ln -f /etc/netdata/charts.d.conf /usr/lib/netdata/conf.d/charts.d.conf
ln -f /etc/netdata/python.d.conf /usr/lib/netdata/conf.d/python.d.conf
sed -i "s/git-.*-\(.*\)/git-\1/g" /usr/lib/lua/luci/version.lua
touch /etc/config/placeholder
exit 0