Skip to content

Commit

Permalink
docs: format readme
Browse files Browse the repository at this point in the history
  • Loading branch information
go-bai committed Jul 25, 2023
1 parent 450a702 commit 3046db9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,11 @@ root@dev:~# dnat delete -id 1
#### 开启 masquerade
```bash
dnat masquerade -A -o eth0
root@dev:~# dnat masquerade -A -o eth0
```
### 关闭 masquerade
#### 关闭 masquerade
```bash
dnat masquerade -D -o eth0
root@dev:~# dnat masquerade -D -o eth0
```
5 changes: 2 additions & 3 deletions cmd/dnat.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package cmd

import (
"fmt"
"time"

"github.com/go-bai/go-dnat/db"
Expand Down Expand Up @@ -71,7 +70,8 @@ func List(cCtx *cli.Context) error {
}

func Get(cCtx *cli.Context) error {
rule, err := rulemodel.Get(cCtx.Int64("id"))
id := cCtx.Int64("id")
rule, err := rulemodel.Get(id)
if err != nil {
return err
}
Expand All @@ -96,7 +96,6 @@ func Sync(cCtx *cli.Context) error {

func Masquerade(cCtx *cli.Context) error {
append, delete, iface := cCtx.Bool("append"), cCtx.Bool("delete"), cCtx.String("o")
fmt.Println(append, delete, iface)
switch {
case append:
if err := iptables.AppendMasqueradeRule(iface); err != nil {
Expand Down

0 comments on commit 3046db9

Please sign in to comment.