-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsubcon.sh
More file actions
28 lines (21 loc) · 716 Bytes
/
subcon.sh
File metadata and controls
28 lines (21 loc) · 716 Bytes
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
#!/bin/bash
banben=./banben
wget -qO- -t1 -T2 "https://api.github.com/repos/tindy2013/subconverter/releases/latest" | grep "tag_name" | head -n 1 | awk -F ":" '{print $2}' | sed 's/\"//g;s/,//g;s/ //g' > $banben
wget "https://github.com/tindy2013/subconverter/releases/download/$(cat $banben)/subconverter_linux64.tar.gz"
rm -rf $banben
tar zxvf subconverter_linux64.tar.gz
rm subconverter_linux64.tar.gz
cat > /lib/systemd/system/sub.service << EOF
[Unit]
Description=subcon service
After=network.target syslog.target
Wants=network.target
[Service]
Type=simple
ExecStart=/root/subconverter/subconverter &
[Install]
WantedBy=multi-user.target
EOF
systemctl start sub
systemctl enable sub
#ufw allow 25500/tcp