summaryrefslogtreecommitdiff
path: root/config.go
diff options
context:
space:
mode:
authorRuben Pollan <meskio@sindominio.net>2018-03-27 22:30:56 +0200
committerKali Kaneko (leap communications) <kali@leap.se>2018-04-11 01:26:37 +0200
commita45d99f2dd4d3694160580184f0573a15c06708f (patch)
treea3f217997daa9dce1dc94125b99ccb1727a306bd /config.go
parent2d0f7c1aa92dee25e923c31456cdd3763dec1ada (diff)
[feat] autoconnect if is the first run or was not manually stopped
- Resolves: #23
Diffstat (limited to 'config.go')
-rw-r--r--config.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/config.go b/config.go
index cf3ae1e..e8b25ab 100644
--- a/config.go
+++ b/config.go
@@ -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()