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 | a811226c53f41b108be5974156ea6459a9764c4d (patch) | |
| tree | dacd4f6efbb9e43de570eacd68492442fea496eb /linuxstatus/hostname.go | |
| parent | b1c7bb8a31c4e02d89a437063516e474e68fab4d (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") |
