From 1e758b65aa58f964a70b82e52bbd9c35b42eacba Mon Sep 17 00:00:00 2001 From: zxb <919411476@qq.com> Date: Fri, 3 Nov 2023 11:50:09 +0800 Subject: [PATCH] README.MD --- README.MD | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) 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