summaryrefslogtreecommitdiff
path: root/bitmask
diff options
context:
space:
mode:
authorRuben Pollan <meskio@sindominio.net>2018-02-14 00:52:45 +0100
committerRuben Pollan <meskio@sindominio.net>2018-02-14 10:46:54 +0100
commita52abd0c722ec08cd95c8c9be76e27a04012b282 (patch)
tree7a8bfd388c0a857fde4e4586fc6a3638d6a888c3 /bitmask
parent352b8dfbe7df572e5ed67f0a2ccedf6f77cdb3b2 (diff)
[feat] install helpers if needed
- Resolves: #6
Diffstat (limited to 'bitmask')
-rw-r--r--bitmask/vpn.go15
1 files changed, 15 insertions, 0 deletions
diff --git a/bitmask/vpn.go b/bitmask/vpn.go
index 8801314..efc6d18 100644
--- a/bitmask/vpn.go
+++ b/bitmask/vpn.go
@@ -40,6 +40,21 @@ func (b *Bitmask) GetStatus() (string, error) {
return res["status"].(string), nil
}
+// InstallHelpers into the system
+func (b *Bitmask) InstallHelpers() error {
+ _, err := b.send("vpn", "install")
+ return err
+}
+
+// VPNCheck returns if the helpers are installed and up to date and if polkit is running
+func (b *Bitmask) VPNCheck() (helpers bool, priviledge bool, err error) {
+ res, err := b.send("vpn", "check", "")
+ if err != nil {
+ return false, false, err
+ }
+ return res["installed"].(bool), res["privcheck"].(bool), nil
+}
+
// ListGateways return the names of the gateways
func (b *Bitmask) ListGateways(provider string) ([]string, error) {
res, err := b.send("vpn", "list")