-
Notifications
You must be signed in to change notification settings - Fork 1
/
diy-part2.sh
47 lines (36 loc) · 1.45 KB
/
diy-part2.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
42
43
44
45
46
47
#!/bin/bash
#
# Copyright (c) 2019-2020 P3TERX <https://p3terx.com>
#
# This is free software, licensed under the MIT License.
# See /LICENSE for more information.
#
# https://github.com/P3TERX/Actions-OpenWrt
# File name: diy-part2.sh
# Description: OpenWrt DIY script part 2 (After Update feeds)
#
# Exit with code 1 if error
set -e
# Modify default IP
sed -i 's/192.168.1.1/192.168.2.1/g' package/base-files/files/bin/config_generate
# Modify default settings
# Patch
# for i in $GITHUB_WORKSPACE/patches/*.patch; do patch --fuzz 3 -p0 < $i; done
# Set permissions
# chmod +x package/feeds/helloworld/luci-app-ssr-plus/root/etc/ssrplus/iptables_config.sh
#修改保留内存到1M
# sed -i '/vm.min_free_kbytes=/d' package/base-files/files/etc/sysctl.conf
# echo 'vm.min_free_kbytes=1024' >> package/base-files/files/etc/sysctl.conf
# bbr & fq_codel
# echo 'net.ipv4.tcp_congestion_control=bbr' >> package/base-files/files/etc/sysctl.d/10-default.conf
# echo 'net.core.default_qdisc=fq_codel' >> package/base-files/files/etc/sysctl.d/10-default.conf
# grep -i OFFLOAD /proc/net/nf_conntrack
echo "
# Put your custom commands here that should be executed once
# the system init finished. By default this file does nothing.
# enable offload
iptables -I FORWARD 1 -m conntrack --ctstate RELATED,ESTABLISHED -j FLOWOFFLOAD
# disable offload
# echo 'iptables -I FORWARD 1 -m conntrack --ctstate RELATED,ESTABLISHED -j FLOWOFFLOAD
exit 0
" > package/base-files/files/etc/rc.local