Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
B
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
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
meskio
bitmask-vpn
Commits
6dc48962
Unverified
Commit
6dc48962
authored
6 years ago
by
meskio
Browse files
Options
Downloads
Patches
Plain Diff
[feat] add a cli client
parent
56c6dbf6
No related branches found
No related tags found
No related merge requests found
Pipeline
#21977
failed
6 years ago
Stage: build
Changes
2
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
.gitignore
+5
-1
5 additions, 1 deletion
.gitignore
cmd/bitmask-cli/main.go
+76
-0
76 additions, 0 deletions
cmd/bitmask-cli/main.go
with
81 additions
and
1 deletion
.gitignore
+
5
−
1
View file @
6dc48962
...
...
@@ -2,7 +2,11 @@
cmd/bitmask-vpn/bitmask-vpn
/bitmask-helper
cmd/bitmask-helper/bitmask-helper
/bitmask-cli
cmd/bitmask-cli/bitmask-cli
locales/*/out.gotext.json
tools/transifex/transifex
.*.swp
*.exe
tools/transifex/transifex
This diff is collapsed.
Click to expand it.
cmd/bitmask-cli/main.go
0 → 100644
+
76
−
0
View file @
6dc48962
// Copyright (C) 2018 LEAP
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
package
main
import
(
"fmt"
"log"
"os"
"os/signal"
"0xacab.org/leap/bitmask-systray/pkg/bitmask"
"golang.org/x/text/language"
"golang.org/x/text/message"
)
const
(
provider
=
"riseup.net"
logFile
=
"systray.log"
)
var
version
string
func
main
()
{
if
len
(
os
.
Args
)
<=
1
{
help
()
os
.
Exit
(
1
)
}
switch
os
.
Args
[
1
]
{
case
"connect"
:
start
()
case
"version"
:
fmt
.
Println
(
version
)
default
:
help
()
}
}
func
help
()
{
fmt
.
Println
(
`Bitmask VPN - commands:
help - Displays this help
connect - Connects to the VPN (stops by ctrl-c)
version - Displays the version`
)
}
func
start
()
{
signalCh
:=
make
(
chan
os
.
Signal
,
1
)
signal
.
Notify
(
signalCh
,
os
.
Interrupt
)
b
,
err
:=
bitmask
.
Init
(
message
.
NewPrinter
(
language
.
English
))
if
err
!=
nil
{
log
.
Fatal
(
err
)
}
defer
b
.
Close
()
err
=
b
.
StartVPN
(
provider
)
if
err
!=
nil
{
log
.
Println
(
err
)
os
.
Exit
(
1
)
}
<-
signalCh
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment