From 0f20d7403f25e8ed7b0d01997be019c561525fba Mon Sep 17 00:00:00 2001 From: "kali kaneko (leap communications)" Date: Tue, 23 Jun 2020 19:51:00 +0200 Subject: [refactor] cleanup function was unneeded --- pkg/backend/actions.go | 4 ++++ pkg/backend/api.go | 5 +++-- pkg/backend/cleanup.go | 9 --------- 3 files changed, 7 insertions(+), 11 deletions(-) delete mode 100644 pkg/backend/cleanup.go (limited to 'pkg/backend') diff --git a/pkg/backend/actions.go b/pkg/backend/actions.go index 725a550..ca45347 100644 --- a/pkg/backend/actions.go +++ b/pkg/backend/actions.go @@ -19,3 +19,7 @@ func stopVPN() { log.Println(err) } } + +func closeVPN() { + ctx.bm.Close() +} diff --git a/pkg/backend/api.go b/pkg/backend/api.go index cf9ec5c..58e0a42 100644 --- a/pkg/backend/api.go +++ b/pkg/backend/api.go @@ -30,10 +30,11 @@ func Unblock() { func Quit() { if ctx.Status != off { go setStatus(stopping) + ctx.cfg.SetUserStoppedVPN(false) + } else { ctx.cfg.SetUserStoppedVPN(true) - stopVPN() } - cleanup() + closeVPN() } func DonateAccepted() { diff --git a/pkg/backend/cleanup.go b/pkg/backend/cleanup.go deleted file mode 100644 index 16f36e4..0000000 --- a/pkg/backend/cleanup.go +++ /dev/null @@ -1,9 +0,0 @@ -package backend - -import ( - "0xacab.org/leap/bitmask-vpn/pkg/vpn" -) - -func cleanup() { - vpn.Cleanup() -} -- cgit v1.2.3