README.MD

This commit is contained in:
zxb 2023-11-03 11:50:09 +08:00
parent 217538bdc5
commit 1e758b65aa

View File

@ -12,4 +12,42 @@ swag init -d ./ -g ./main.go -pd
编译 编译
```shell ```shell
go build -o iptables-helper main.go 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
``` ```