diff options
| author | Jeff Carr <[email protected]> | 2024-01-07 07:09:59 -0600 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2024-01-07 07:09:59 -0600 |
| commit | 807b3be94f4be4b1aeea48695474aca1bfef4ab2 (patch) | |
| tree | 5af8e1b94ebbe5bb7148848aa926ab74f1ab2793 /linuxstatus/hostname.go | |
| parent | 930bdc941b1181460f4c38dc708dc53d583ab5d3 (diff) | |
window titles update to correct values
Signed-off-by: Jeff Carr <[email protected]>
Diffstat (limited to 'linuxstatus/hostname.go')
| -rw-r--r-- | linuxstatus/hostname.go | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/linuxstatus/hostname.go b/linuxstatus/hostname.go index d31299f..184e593 100644 --- a/linuxstatus/hostname.go +++ b/linuxstatus/hostname.go @@ -4,8 +4,8 @@ package linuxstatus import ( "strings" + "io/ioutil" "go.wit.com/log" - "go.wit.com/shell" // will try to get this hosts FQDN "github.com/Showmax/go-fqdn" @@ -124,7 +124,14 @@ func lookupHostname() { // On Linux, /etc/hosts, /etc/hostname // and domainname and hostname func goodHostname() bool { - hostname := shell.Chomp(shell.Cat("/etc/hostname")) + content, err := ioutil.ReadFile("/etc/hostname") + if err != nil { + // this needs to be a fixWindow() error + log.Error(err) + } + + hostname := string(content) + log.Log(NOW, "hostname =", hostname) hs := run("hostname -s") |
