-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathudp.sh
More file actions
56 lines (45 loc) · 1.25 KB
/
udp.sh
File metadata and controls
56 lines (45 loc) · 1.25 KB
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
#!/bin/bash
cd
rm -rf /root/udp
mkdir -p /root/udp
# change to time GMT+7
echo "change to time GMT+7"
ln -fs /usr/share/zoneinfo/Asia/Jakarta /etc/localtime
# install udp-custom
echo downloading udp-custom
wget -q -O /root/udp/udp-custom "https://raw.githubusercontent.com/Lisaanjel/Autoscript-by-vpnshare/main/udp/udp-custom-linux-amd64" && chmod +x /root/udp/udp-custom
echo downloading default config
wget -q -O /root/udp/config.json "https://raw.githubusercontent.com/Lisaanjel/Autoscript-by-vpnshare/main/udp/config.json" && chmod 644 /root/udp/config.json
if [ -z "$1" ]; then
cat <<EOF > /etc/systemd/system/udp-custom.service
[Unit]
Description=UDP Custom by ePro Dev. Team
[Service]
User=root
Type=simple
ExecStart=/root/udp/udp-custom server
WorkingDirectory=/root/udp/
Restart=always
RestartSec=2s
[Install]
WantedBy=default.target
EOF
else
cat <<EOF > /etc/systemd/system/udp-custom.service
[Unit]
Description=UDP Custom by ePro Dev. Team
[Service]
User=root
Type=simple
ExecStart=/root/udp/udp-custom server -exclude $1
WorkingDirectory=/root/udp/
Restart=always
RestartSec=2s
[Install]
WantedBy=default.target
EOF
fi
echo start service udp-custom
systemctl start udp-custom &>/dev/null
echo enable service udp-custom
systemctl enable udp-custom &>/dev/null