Initial commit
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
//go:build linux
|
||||
|
||||
package main
|
||||
|
||||
import "errors"
|
||||
|
||||
func getHostsFileLocation() (string, error) {
|
||||
var hostsFileLocation string
|
||||
hostsFileLocation = "/etc/hosts"
|
||||
exists, err := fileExists(hostsFileLocation)
|
||||
if err != nil {
|
||||
term(err)
|
||||
}
|
||||
if exists == false {
|
||||
term(errors.New("hosts file does not exist at " + hostsFileLocation))
|
||||
}
|
||||
return hostsFileLocation, nil
|
||||
}
|
||||
Reference in New Issue
Block a user