Commit fc057460 authored by meskio's avatar meskio

[bug] start VPN automatically on first launch

When there was no configuration file the 'conf.StartVPN' was set tu
false. Let's set it properly even if there is no config file.

- Resolves: #128
parent 75bb409f
Pipeline #24799 passed with stages
in 14 minutes and 51 seconds
......@@ -57,12 +57,11 @@ func ParseConfig() *Config {
f, err := os.Open(configPath)
if err != nil {
conf.save()
return &conf
} else {
defer f.Close()
dec := json.NewDecoder(f)
err = dec.Decode(&conf.file)
}
defer f.Close()
dec := json.NewDecoder(f)
err = dec.Decode(&conf.file)
conf.SelectGateway = conf.file.SelectGateway
conf.DisableAustostart = conf.file.DisableAustostart
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment