diff options
author | Ruben Pollan <meskio@sindominio.net> | 2018-02-13 12:48:11 +0100 |
---|---|---|
committer | Ruben Pollan <meskio@sindominio.net> | 2018-02-13 12:48:11 +0100 |
commit | 340834baecb0521bde93623fb2449720ce79b1f6 (patch) | |
tree | 327eee54d7cce13a75ced7f5837d8110585083c9 | |
parent | 3b4c2e8c5767d3bbc1a1963a4ffc956d2dc0fcfb (diff) |
Close bitmask when the systray quits
-rw-r--r-- | bitmask/main.go | 5 | ||||
-rw-r--r-- | main.go | 1 |
2 files changed, 6 insertions, 0 deletions
diff --git a/bitmask/main.go b/bitmask/main.go index a6452ca..b101367 100644 --- a/bitmask/main.go +++ b/bitmask/main.go @@ -3,6 +3,7 @@ package bitmask import ( "encoding/json" "errors" + "log" "github.com/pebbe/zmq4" ) @@ -43,6 +44,10 @@ func (b *Bitmask) GetStatusCh() chan string { // Close the connection to bitmask func (b *Bitmask) Close() { + _, err := b.send("core", "stop") + if err != nil { + log.Printf("Got an error stopping bitmaskd: %v", err) + } b.coresoc.Close() } @@ -22,6 +22,7 @@ func main() { if err != nil { log.Fatal(err) } + defer b.Close() run(b, conf) } |