Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

在README.md中添加:脚本安装后,创建系统开机自启动服务的说明。 #43

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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