diff options
| author | Paul Buetow <paul@buetow.org> | 2026-03-02 12:41:08 +0200 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2026-03-02 12:41:08 +0200 |
| commit | d0b9bc84aed1898a06a9d6fc3b82beee407d3cde (patch) | |
| tree | 7bb343960ee912d77dbc9f7720cd8cdd1f0172ea /internal/collector/collector.go | |
| parent | bbc91e8764bd83c4497f2ddac86bb8947a91765c (diff) | |
Refactor display iteration/state and harden collector runtime
Diffstat (limited to 'internal/collector/collector.go')
| -rw-r--r-- | internal/collector/collector.go | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/internal/collector/collector.go b/internal/collector/collector.go index 5c99347..9ee7e02 100644 --- a/internal/collector/collector.go +++ b/internal/collector/collector.go @@ -5,6 +5,7 @@ import ( "bytes" "context" "fmt" + "os" "os/exec" "strings" "time" @@ -163,8 +164,8 @@ func isLocal(h string) bool { // getLocalScript returns the appropriate script for the local OS func getLocalScript() []byte { - // Check if /proc exists (Linux/Unix) - if _, err := exec.Command("test", "-d", "/proc").CombinedOutput(); err == nil { + // Check if /proc exists (Linux/Unix). + if st, err := os.Stat("/proc"); err == nil && st.IsDir() { return LinuxScript } // /proc not found - unsupported OS for local stats gathering |
