diff options
author | Kali Kaneko (leap communications) <kali@leap.se> | 2019-07-15 18:06:29 +0200 |
---|---|---|
committer | Ruben Pollan <meskio@sindominio.net> | 2019-08-05 11:46:16 -0400 |
commit | 1106467f972e6e5d6781412e999d7c44195bb2df (patch) | |
tree | a0f72d3902407564439cfe866aeba4a03d9854bb /pkg/helper/darwin.go | |
parent | f8218b2beb8b184e7b3585f1280695ecfef040f9 (diff) |
[feat] osx build templates
Diffstat (limited to 'pkg/helper/darwin.go')
-rw-r--r-- | pkg/helper/darwin.go | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/pkg/helper/darwin.go b/pkg/helper/darwin.go index 49924e5..a1e1f00 100644 --- a/pkg/helper/darwin.go +++ b/pkg/helper/darwin.go @@ -102,13 +102,21 @@ func firewallStart(gateways []string) error { } func firewallStop() error { - return exec.Command(pfctl, "-a", bitmask_anchor, "-F", "all").Run() + out, err := exec.Command(pfctl, "-a", bitmask_anchor, "-F", "all").Output() + if err != nil { + log.Printf("An error ocurred stopping the firewall: %v", out) + /* TODO return error if different from anchor not exists */ + /*return errors.New("Error while stopping firewall")*/ + return nil + } + return nil } func firewallIsUp() bool { out, err := exec.Command(pfctl, "-a", bitmask_anchor, "-sr").Output() if err != nil { log.Printf("An error ocurred getting the status of the firewall: %v", err) + log.Printf(string(out)) return false } return bytes.Contains(out, []byte("block out proto udp to any port 53")) |