diff options
| author | Jeff Carr <[email protected]> | 2024-01-06 05:32:52 -0600 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2024-01-06 05:32:52 -0600 |
| commit | 1de593fd63d075b58e97ff9a656acef99938e487 (patch) | |
| tree | 742656397da0fabfd6be7dcad62d2c68dba82e96 | |
| parent | 4529b473dc12d8a4d1b49c9ee1ba89897f86d616 (diff) | |
move UID code
Signed-off-by: Jeff Carr <[email protected]>
| -rw-r--r-- | linuxstatus/linuxloop.go | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/linuxstatus/linuxloop.go b/linuxstatus/linuxloop.go index 44946c6..fbbe653 100644 --- a/linuxstatus/linuxloop.go +++ b/linuxstatus/linuxloop.go @@ -5,6 +5,8 @@ package linuxstatus import ( + "os" + "os/user" "strconv" "go.wit.com/log" @@ -30,6 +32,12 @@ func linuxLoop() { } // me.IPv6.SetText(all) + user, _ := user.Current() + log.Println("os.Getuid =", user.Username, os.Getuid()) + if (me.uid != nil) { + me.uid.Set(user.Username + " (" + strconv.Itoa(os.Getuid()) + ")") + } + /* processName := getProcessNameByPort(53) fmt.Println("Process with port 53:", processName) |
