-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patharm64.sh
179 lines (164 loc) · 3.78 KB
/
arm64.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
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
#!/bin/bash
ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
yum update -y
yum install -y wget
yum install -y screen
yum install -y epel-release
yum install -y unzip
yum install -y gzip
yum install -y openssl
yum install -y openssl-devel
yum install -y gcc
yum install -y python
yum install -y python-devel
yum install -y python-setuptools
yum install -y pcre
yum install -y pcre-devel
yum install -y libtool
yum install -y libevent
yum install -y autoconf
yum install -y automake
yum install -y make
yum install -y curl
yum install -y curl-devel
yum install -y zlib-devel
yum install -y perl
yum install -y perl-devel
yum install -y cpio
yum install -y expat-devel
yum install -y gettext-devel
yum install -y libev-devel
yum install -y c-ares-devel
yum install -y git
yum install -y qrencode
wget --no-check-certificate https://github.com/shadowsocks/shadowsocks/archive/master.zip
unzip -q master.zip
cd shadowsocks-master
python setup.py install
cd /
cat>/etc/shadowsocks-config.json<<EOF
{
"server":"0.0.0.0",
"local_address": "127.0.0.1",
"port_password":
{
"443":"caocaocao"
},
"local_port":1080,
"timeout":300,
"method":"aes-256-gcm",
"fast_open": false
}
EOF
cat>/etc/systemd/system/shadowsocks-server.service<<EOF
[Unit]
Description=Shadowsocks Server
After=network.target
[Service]
ExecStart=/usr/bin/ssserver -c /etc/shadowsocks-config.json
Restart=always
[Install]
WantedBy=multi-user.target
EOF
systemctl daemon-reload
systemctl enable shadowsocks-server
systemctl restart shadowsocks-server
VERSION=20230214
wget --no-check-certificate https://github.com/xtaci/kcptun/releases/download/v$VERSION/kcptun-linux-amd64-$VERSION.tar.gz
wget --no-check-certificate https://github.com/xtaci/kcptun/releases/download/v$VERSION/kcptun-linux-arm64-$VERSION.tar.gz
tar zxf kcptun-linux-amd64-$VERSION.tar.gz
chmod a+x server_linux_amd64
mv -f server_linux_amd64 /usr/bin
tar zxf kcptun-linux-arm64-$VERSION.tar.gz
chmod a+x server_linux_arm64
mv -f server_linux_arm64 /usr/bin
cat>/etc/kcptun-config.json<<EOF
{
"listen": ":38000-39000",
"target": "127.0.0.1:443",
"key": "jj3G83hkds",
"crypt": "aes",
"conn": 60,
"mode": "manual",
"nodelay": 1,
"interval": 20,
"resend": 2,
"nc": 1,
"mtu": 1450,
"sndwnd": 4096,
"rcvwnd": 2048,
"datashard": 10,
"parityshard": 3,
"dscp": 46,
"nocomp": true,
"sockbuf": 10485760,
"smuxver": 2,
"smuxbuf": 10485760,
"streambuf": 10485760,
"keepalive": 10,
"quiet": true,
"autoexpire": 30,
"scavengettl": 120,
"acknodelay": true,
"pprof": false
}
EOF
cat>/etc/systemd/system/kcptun-server.service<<EOF
[Unit]
Description=Kcptun server
After=network.target
[Service]
ExecStart=/usr/bin/server_linux_arm64 -c /etc/kcptun-config.json
Restart=always
[Install]
WantedBy=multi-user.target
EOF
cat>/etc/kcptun-android.json<<EOF
{
"listen": ":51000-52000",
"target": "127.0.0.1:443",
"key": "jj3G83hkds",
"crypt": "aes",
"conn": 60,
"mode": "manual",
"nodelay": 1,
"interval": 20,
"resend": 2,
"nc": 1,
"mtu": 1450,
"sndwnd": 4096,
"rcvwnd": 2048,
"datashard": 10,
"parityshard": 3,
"dscp": 46,
"nocomp": true,
"sockbuf": 10485760,
"smuxver": 1,
"smuxbuf": 10485760,
"streambuf": 10485760,
"keepalive": 10,
"quiet": true,
"autoexpire": 30,
"scavengettl": 120,
"acknodelay": true,
"pprof": false
}
EOF
cat>/etc/systemd/system/kcptun-android.service<<EOF
[Unit]
Description=Kcptun Android
After=network.target
[Service]
ExecStart=/usr/bin/server_linux_arm64 -c /etc/kcptun-android.json
Restart=always
[Install]
WantedBy=multi-user.target
EOF
systemctl daemon-reload
systemctl enable kcptun-server
systemctl restart kcptun-server
systemctl enable kcptun-android
systemctl restart kcptun-android
systemctl status shadowsocks-server
systemctl status kcptun-server
systemctl status kcptun-android