Skip to content

Commit

Permalink
在README.md中添加:脚本安装后,创建系统开机自启动服务的说明。
Browse files Browse the repository at this point in the history
  • Loading branch information
blueveryday committed May 6, 2024
1 parent 4101bda commit 7c768b0
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,30 @@ Telegram 群组:https://t.me/EllerHK
rm -rf /home/mtproxy && mkdir /home/mtproxy && cd /home/mtproxy
curl -fsSL -o mtproxy.sh https://github.com/ellermister/mtproxy/raw/master/mtproxy.sh
bash mtproxy.sh
```

创建系统服务
```
cat > /etc/systemd/system/mtp.service <<EOF
[Unit]
Description=mtp
After=network.target
[Service]
Type=forking
ExecStart=/bin/bash /home/mtproxy/mtproxy.sh start
ExecReload=/bin/bash /home/mtproxy/mtproxy.sh restart
ExecStop=/bin/bash /home/mtproxy/mtproxy.sh stop
[Install]
WantedBy=multi-user.target
EOF
```

启动服务并设置开机自启
```
systemctl start mtp
systemctl enable mtp
```

![mtproxy.sh](https://raw.githubusercontent.com/ellermister/mtproxy/master/mtproxy.jpg)
Expand Down

0 comments on commit 7c768b0

Please sign in to comment.