diff options
author | Ruben Pollan <meskio@sindominio.net> | 2019-02-04 23:36:37 +0100 |
---|---|---|
committer | Ruben Pollan <meskio@sindominio.net> | 2019-02-04 23:36:37 +0100 |
commit | d0703ec25f2625ffd61489da4e2f45a7bc1be29b (patch) | |
tree | d0b77fdabf3a4c46ebef4bd868e6af2b74d87775 /cmd | |
parent | b9ef49b51c6e2570ef3aae824ab44374997b6b25 (diff) |
[feat] Add -start-vpn flag
The -start-vpn flag can be set to on or off to turn the vpn on or off
just after launching bitmask-vpn. So it doesn't depend on the status of
the vpn of the last run.
- Resolves: #114
Diffstat (limited to 'cmd')
-rw-r--r-- | cmd/bitmask-vpn/main.go | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/cmd/bitmask-vpn/main.go b/cmd/bitmask-vpn/main.go index ad85b0e..77ace31 100644 --- a/cmd/bitmask-vpn/main.go +++ b/cmd/bitmask-vpn/main.go @@ -51,12 +51,20 @@ func main() { selectGateway := flag.Bool("select-gateway", false, "Enable gateway selection") disableAutostart := flag.Bool("disable-autostart", false, "Disable the autostart for the next run") + startVPN := flag.String("start-vpn", "", "Start the vpn in turned 'on' or 'off'") versionFlag := flag.Bool("version", false, "Version of the bitmask-systray") flag.Parse() if *versionFlag { fmt.Println(version) os.Exit(0) } + if *startVPN != "" { + if *startVPN != "on" && *startVPN != "off" { + fmt.Println("-start-vpn should be 'on' or 'off'") + os.Exit(1) + } + conf.StartVPN = *startVPN == "on" + } if *selectGateway { conf.SelectGateway = *selectGateway } |