diff --git a/README.MD b/README.MD index 8c2693f..1c1b737 100644 --- a/README.MD +++ b/README.MD @@ -12,4 +12,42 @@ swag init -d ./ -g ./main.go -pd 编译 ```shell go build -o iptables-helper main.go +``` + +### 部署步骤 + +#### 创建目录 +```shell +sudo mkdir -p /opt/iptables-helper +``` + +将压缩包内文件全部解压至 /opt/iptables-helper 目录下 +压缩包内自带 config.toml 配置 +若该配置不存在则自动生成并退出 + +运行时将会自动保存 iptables 配置于 /etc/iptables.rule + +```shell +# 赋予可执行权限 +sudo chmod +x iptables-helper + +# 部署 服务配置 +sudo cp iptables-helper.service /etc/systemd/system/ + +# 重载 服务配置 +sudo systemctl daemon-reload + +# 设置开机自启动 +sudo systemctl enable --now iptables-helper + +# 查看服务状态 +sudo systemctl status iptables-helper +``` + +```shell +# 手动启动服务 +sudo systemctl start iptables-helper + +# 手动停止服务 +sudo systemctl stop iptables-helper ``` \ No newline at end of file