mirror of
https://github.com/evilsocket/opensnitch.git
synced 2025-03-04 08:34:40 +01:00
removed fw rules initialization from main
now they're added after loading the configuration.
This commit is contained in:
parent
64a698f221
commit
bc32094945
1 changed files with 6 additions and 14 deletions
|
@ -576,6 +576,11 @@ func main() {
|
|||
log.Fatal("Error accessing rules path (does it exist?): %s", err)
|
||||
}
|
||||
|
||||
if cfg.FwOptions.ConfigPath == "" {
|
||||
cfg.FwOptions.ConfigPath = fwConfigFile
|
||||
}
|
||||
log.Info("Using system fw configuration %s ...", fwConfigFile)
|
||||
|
||||
setupSignals()
|
||||
|
||||
log.Info("Loading rules from %s ...", rulesPath)
|
||||
|
@ -592,20 +597,7 @@ func main() {
|
|||
setupWorkers()
|
||||
setupQueues()
|
||||
|
||||
fwConfigPath := fwConfigFile
|
||||
if fwConfigPath == "" {
|
||||
fwConfigPath = cfg.FwOptions.ConfigPath
|
||||
}
|
||||
log.Info("Using system fw configuration %s ...", fwConfigPath)
|
||||
// queue is ready, run firewall rules and start intercepting connections
|
||||
if err = firewall.Init(
|
||||
uiClient.GetFirewallType(),
|
||||
fwConfigPath,
|
||||
cfg.FwOptions.MonitorInterval,
|
||||
&queueNum); err != nil {
|
||||
log.Warning("%s", err)
|
||||
uiClient.SendWarningAlert(err)
|
||||
}
|
||||
// queue and firewall rules should be ready by now
|
||||
|
||||
uiClient.Connect()
|
||||
listenToEvents()
|
||||
|
|
Loading…
Add table
Reference in a new issue