summaryrefslogtreecommitdiff
path: root/hostname.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2023-12-16 09:02:59 -0600
committerJeff Carr <[email protected]>2023-12-16 09:02:59 -0600
commita33eca708a44bb8b9af1790413d56236dc504295 (patch)
treee5a629088b5b5b92219ccd6b8b2365118f4a897b /hostname.go
parent7317b3d124c2c75423d8a7311ceec3c12ec71dd3 (diff)
gocui mode works again
Signed-off-by: Jeff Carr <[email protected]>
Diffstat (limited to 'hostname.go')
-rw-r--r--hostname.go26
1 files changed, 20 insertions, 6 deletions
diff --git a/hostname.go b/hostname.go
index b4b0d42..cf033df 100644
--- a/hostname.go
+++ b/hostname.go
@@ -5,7 +5,10 @@
package main
-// import "net"
+import (
+ "log"
+ "git.wit.org/wit/shell"
+)
// will try to get this hosts FQDN
import "github.com/Showmax/go-fqdn"
@@ -21,7 +24,7 @@ func getHostname() {
var s string = "gui.Label == nil"
s, err = fqdn.FqdnHostname()
if (err != nil) {
- log("FQDN hostname error =", err)
+ log.Println("FQDN hostname error =", err)
return
}
if (me.fqdn != nil) {
@@ -31,19 +34,30 @@ func getHostname() {
me.changed = true
}
}
- log("FQDN =", s)
+ log.Println("FQDN =", s)
+}
+
+// returns true if the hostname is good
+// check that all the OS settings are correct here
+// On Linux, /etc/hosts, /etc/hostname
+// and domainname and hostname
+func goodHostname(h string) bool {
+ hostname := shell.Cat("/etc/hostname")
+ log.Println("hostname =", hostname)
+
+ return false
}
func dnsAAAA(s string) []string {
var aaaa []string
// lookup the IP address from DNS
rrset := dnssecsocket.Dnstrace(s, "AAAA")
- log(args.VerboseDNS, SPEW, rrset)
+ log.Println(args.VerboseDNS, SPEW, rrset)
for i, rr := range rrset {
- log(args.VerboseDNS, "r.Answer =", i, rr)
+ log.Println(args.VerboseDNS, "r.Answer =", i, rr)
ipaddr := dns.Field(rr, 1)
aaaa = append(aaaa, ipaddr)
}
- log(args.VerboseDNS, "aaaa =", aaaa)
+ log.Println(args.VerboseDNS, "aaaa =", aaaa)
return aaaa
}