README.MD
This commit is contained in:
parent
217538bdc5
commit
1e758b65aa
38
README.MD
38
README.MD
@ -13,3 +13,41 @@ 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
|
||||
```
|
Loading…
Reference in New Issue
Block a user