diff options
Diffstat (limited to 'config.go')
-rw-r--r-- | config.go | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -38,6 +38,7 @@ type systrayConfig struct { LastNotification time.Time Donated time.Time SelectWateway bool + UserStoppedVPN bool } func parseConfig() *systrayConfig { @@ -45,6 +46,7 @@ func parseConfig() *systrayConfig { f, err := os.Open(configPath) if err != nil { + conf.save() return &conf } defer f.Close() @@ -55,6 +57,11 @@ func parseConfig() *systrayConfig { return &conf } +func (c *systrayConfig) setUserStoppedVPN(vpnStopped bool) error { + c.UserStoppedVPN = vpnStopped + return c.save() +} + func (c *systrayConfig) parseFlags() { flag.BoolVar(&c.SelectWateway, "select-gateway", false, "Enable gateway selection") flag.Parse() |