Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
bitmask-vpn
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
leap
bitmask-vpn
Merge requests
!61
disable autostart and start-vpn flag
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
disable autostart and start-vpn flag
meskio/bitmask-vpn:feat/100_autostart_flag
into
master
Overview
0
Commits
2
Pipelines
1
Changes
5
Merged
meskio
requested to merge
meskio/bitmask-vpn:feat/100_autostart_flag
into
master
6 years ago
Overview
0
Commits
2
Pipelines
1
Changes
5
Expand
#100 (closed)
#114 (closed)
0
0
Merge request reports
Compare
master
master (base)
and
latest version
latest version
d0703ec2
2 commits,
6 years ago
5 files
+
51
−
20
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
5
Search (e.g. *.vue) (Ctrl+P)
cmd/bitmask-vpn/main.go
+
16
−
1
Options
@@ -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