diff options
Diffstat (limited to 'pkg/vpn/bonafide/eip_service.go')
-rw-r--r-- | pkg/vpn/bonafide/eip_service.go | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/pkg/vpn/bonafide/eip_service.go b/pkg/vpn/bonafide/eip_service.go index 1b8dc01..5b4c3df 100644 --- a/pkg/vpn/bonafide/eip_service.go +++ b/pkg/vpn/bonafide/eip_service.go @@ -6,6 +6,7 @@ import ( "io" "log" "os" + "path/filepath" "strings" "time" @@ -148,6 +149,17 @@ func (b *Bonafide) fetchEipJSON() error { return nil } +func (b *Bonafide) parseEipJSONFromFile() error { + provider := strings.ToLower(config.Provider) + eipFile := filepath.Join(config.Path, provider+"-eip.json") + f, err := os.Open(eipFile) + if err != nil { + return err + } + b.eip, err = decodeEIP3(f) + return err +} + func decodeEIP3(body io.Reader) (*eipService, error) { var eip eipService decoder := json.NewDecoder(body) |