diff options
Diffstat (limited to 'linuxstatus')
| -rw-r--r-- | linuxstatus/draw.go | 6 | ||||
| -rw-r--r-- | linuxstatus/hostname.go | 4 | ||||
| -rw-r--r-- | linuxstatus/linuxloop.go | 13 | ||||
| -rw-r--r-- | linuxstatus/net.go | 2 | ||||
| -rw-r--r-- | linuxstatus/structs.go | 2 |
5 files changed, 13 insertions, 14 deletions
diff --git a/linuxstatus/draw.go b/linuxstatus/draw.go index 6680f2d..5d28347 100644 --- a/linuxstatus/draw.go +++ b/linuxstatus/draw.go @@ -9,15 +9,17 @@ import ( // it's assumed you are always passing in a box func draw(ls *LinuxStatus) { if ! ls.Ready() {return} - ls.group = ls.window.Box().NewGroup("Real Stuff") + ls.group = ls.window.Box().NewGroup("What Linux Says It Is") ls.grid = ls.group.NewGrid("gridnuts", 2, 2) ls.grid.SetNext(1,1) + ls.fqdn = gadgets.NewOneLiner(ls.grid, "hostname -f") ls.hostshort = gadgets.NewOneLiner(ls.grid, "hostname -s") ls.domainname = gadgets.NewOneLiner(ls.grid, "domain name") - ls.NSrr = gadgets.NewOneLiner(ls.grid, "NS records =") + ls.resolver = gadgets.NewOneLiner(ls.grid, "nameservers =") + ls.resolver.Set("TODO") ls.uid = gadgets.NewOneLiner(ls.grid, "UID =") ls.IPv4 = gadgets.NewOneLiner(ls.grid, "Current IPv4 =") ls.IPv6 = gadgets.NewOneLiner(ls.grid, "Current IPv6 =") diff --git a/linuxstatus/hostname.go b/linuxstatus/hostname.go index 08c7971..78682dd 100644 --- a/linuxstatus/hostname.go +++ b/linuxstatus/hostname.go @@ -50,7 +50,7 @@ func (ls *LinuxStatus) GetHostShort() string { } func (ls *LinuxStatus) setHostShort() { - if ! me.Ready() {return ""} + if ! me.Ready() {return} hshort := run("hostname -s") if (me.hostshort.Get() != hshort) { log.Log(CHANGE, "hostname -s has changed from", me.hostshort.Get(), "to", hshort) @@ -71,7 +71,7 @@ func lookupHostname() { log.Error(errors.New("full hostname should be: " + s)) me.setDomainName() - + me.setHostShort() /* var test string diff --git a/linuxstatus/linuxloop.go b/linuxstatus/linuxloop.go index ba981aa..b2572d1 100644 --- a/linuxstatus/linuxloop.go +++ b/linuxstatus/linuxloop.go @@ -8,6 +8,7 @@ import ( "os" "os/user" "strconv" + "strings" "go.wit.com/log" ) @@ -23,14 +24,10 @@ func linuxLoop() { log.Log(NET, strconv.Itoa(i) + " iface = " + t.iface.Name) } - var aaaa []string - aaaa = dhcpAAAA() - var all string - for _, s := range aaaa { - log.Log(NET, "my actual AAAA = ",s) - all += s + "\n" - } - // me.IPv6.SetText(all) + // get all the real AAAA records from all the network interfaces linux can see + tmp := strings.Join(realAAAA(), "\n") + tmp = sortLines(tmp) + me.workingIPv6.Set(tmp) user, _ := user.Current() log.Log(INFO, "os.Getuid =", user.Username, os.Getuid()) diff --git a/linuxstatus/net.go b/linuxstatus/net.go index d86aac5..89f6de0 100644 --- a/linuxstatus/net.go +++ b/linuxstatus/net.go @@ -103,7 +103,7 @@ func checkInterface(i net.Interface) { These are the real IP address you have been given from DHCP */ -func dhcpAAAA() []string { +func realAAAA() []string { var aaaa []string for s, t := range me.ipmap { diff --git a/linuxstatus/structs.go b/linuxstatus/structs.go index 10fec02..a012074 100644 --- a/linuxstatus/structs.go +++ b/linuxstatus/structs.go @@ -30,7 +30,7 @@ type LinuxStatus struct { hostshort *gadgets.OneLiner domainname *gadgets.OneLiner fqdn *gadgets.OneLiner - NSrr *gadgets.OneLiner + resolver *gadgets.OneLiner uid *gadgets.OneLiner IPv4 *gadgets.OneLiner IPv6 *gadgets.OneLiner |
