Skip to content
Snippets Groups Projects
Unverified Commit a9ab5e74 authored by meskio's avatar meskio :tent:
Browse files

[bug] wait for tear down

Before finishing the main thread let's wait for the finish of the
bitmask/pid/... tear down. So the firewall gets down when you ctrl-c.

- Resolves: #142
parent 56d79a60
No related branches found
No related tags found
1 merge request!70check if polkit, stop firewall when exit and fix CI
......@@ -25,11 +25,14 @@ import (
func Run(conf *Config) {
bt := bmTray{conf: conf, waitCh: make(chan bool)}
go initialize(conf, &bt)
finishedCh := make(chan bool)
go initialize(conf, &bt, finishedCh)
bt.start()
<-finishedCh
}
func initialize(conf *Config, bt *bmTray) {
func initialize(conf *Config, bt *bmTray, finishedCh chan bool) {
defer func() { finishedCh <- true }()
if _, err := os.Stat(config.Path); os.IsNotExist(err) {
os.MkdirAll(config.Path, os.ModePerm)
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment