Skip to content
Snippets Groups Projects

disable autostart and start-vpn flag

Merged meskio requested to merge meskio/bitmask-vpn:feat/100_autostart_flag into master
5 files
+ 51
20
Compare changes
  • Side-by-side
  • Inline
Files
5
+ 16
1
@@ -49,13 +49,28 @@ func main() {
conf := systray.ParseConfig()
flag.BoolVar(&conf.SelectGateway, "select-gateway", false, "Enable gateway selection")
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
}
if *disableAutostart {
conf.DisableAustostart = *disableAutostart
}
conf.Version = version
conf.Printer = initPrinter()
Loading