From 1106467f972e6e5d6781412e999d7c44195bb2df Mon Sep 17 00:00:00 2001 From: "Kali Kaneko (leap communications)" Date: Mon, 15 Jul 2019 18:06:29 +0200 Subject: [feat] osx build templates --- pkg/config/config.go | 2 +- pkg/helper/darwin.go | 10 +++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) (limited to 'pkg') 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")) -- cgit v1.2.3