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/vpn/main.go | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) (limited to 'pkg/vpn') diff --git a/pkg/vpn/main.go b/pkg/vpn/main.go index f3c5b83..4bf4395 100644 --- a/pkg/vpn/main.go +++ b/pkg/vpn/main.go @@ -19,8 +19,6 @@ import ( "io/ioutil" "log" "os" - "path" - "path/filepath" "0xacab.org/leap/bitmask-vpn/pkg/config" "0xacab.org/leap/bitmask-vpn/pkg/vpn/bonafide" @@ -76,7 +74,7 @@ func (b *Bitmask) GetStatusCh() <-chan string { return b.statusCh } -// Close the connection to bitmask +// Close the connection to bitmask, and does cleanup of temporal files func (b *Bitmask) Close() { log.Printf("Close: cleanup and vpn shutdown...") b.StopVPN() @@ -94,11 +92,3 @@ func (b *Bitmask) Close() { func (b *Bitmask) Version() (string, error) { return "", nil } - -func Cleanup() { - dirs, _ := filepath.Glob(path.Join(os.TempDir(), "leap-*")) - for _, d := range dirs { - log.Println("removing temp dir:", d) - os.RemoveAll(d) - } -} -- cgit v1.2.3