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 | |
parent | f8218b2beb8b184e7b3585f1280695ecfef040f9 (diff) |
[feat] osx build templates
Diffstat (limited to 'pkg')
-rw-r--r-- | pkg/config/config.go | 2 | ||||
-rw-r--r-- | pkg/helper/darwin.go | 10 |
2 files changed, 10 insertions, 2 deletions
diff --git a/pkg/config/config.go b/pkg/config/config.go index 18f6667..c174b6b 100644 --- a/pkg/config/config.go +++ b/pkg/config/config.go @@ -1,6 +1,6 @@ // Code generated by go generate; DO NOT EDIT. // This file was generated by vendorize.py -// At 2019-07-09 18:54:26 +// At 2019-07-16 21:41:09 package config 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")) |