-
Notifications
You must be signed in to change notification settings - Fork 0
/
script_ss.sh
46 lines (46 loc) · 1.03 KB
/
script_ss.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
#!/bin/bash
bash -c "$(curl -L https://github.com/XTLS/Xray-install/raw/main/install-release.sh)" @ install
apt update
apt install cron ufw
echo "input ip"
read ip
echo "input port"
read port
echo "input psk"
read psk
cat >/usr/local/etc/xray/config.json<<EOF
{
"log": null,
"inbounds": [
{
"listen": "$ip",
"port": $port,
"protocol": "shadowsocks",
"settings": {
"network": "tcp,udp",
"method": "2022-blake3-aes-128-gcm",
"password": "$psk"
},
"streamSettings": {
"network": "tcp"
}
}
],
"outbounds": [
{
"protocol": "freedom",
"tag": "direct"
}
]
}
EOF
ufw enable
ufw allow $port
ufw reload
systemctl restart xray.service
echo "auto update?[y/n]"
read x1
if [[ $x1 == "y" ]];then
(crontab -l; echo '0 6 * * 1 bash -c "$(curl -L https://github.com/XTLS/Xray-install/raw/main/install-release.sh)" @ install') | crontab -
crontab -l
fi