-
Notifications
You must be signed in to change notification settings - Fork 0
/
frps.install.sh
42 lines (35 loc) · 897 Bytes
/
frps.install.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
FRP_token=a123456
FRP_version=0.44.0
FRP_admin_password=a123456
wget https://github.com/fatedier/frp/releases/download/v${FRP_version}/frp_${FRP_version}_linux_amd64.tar.gz
tar -zxvf frp_${FRP_version}_linux_amd64.tar.gz
cd frp_${FRP_version}_linux_amd64/
cat <<EOF > frps.ini
[common]
bind_port = 7000
token = $FRP_token
dashboard_port = 7001
dashboard_user = admin
dashboard_pwd = $FRP_admin_password
enable_prometheus = true
log_file = /var/log/frps.log
log_level = info
log_max_days = 3
EOF
cat <<EOF > frps.service
[Unit]
Description=frps
After=network.target
[Service]
TimeoutStartSec=30
ExecStart=/usr/local/bin/frps -c /etc/frp/frps.ini
ExecStop=/bin/kill $MAINPID
[Install]
WantedBy=multi-user.target
EOF
sudo mv frps.service /usr/lib/systemd/system/
sudo mkdir -p /etc/frp
sudo cp frps.ini /etc/frp
sudo cp frps /usr/local/bin
sudo systemctl enable frps
sudo systemctl start frps