Skip to content

Commit

Permalink
Fixes #152, missing thermal device on FreeBSD reported as error, when…
Browse files Browse the repository at this point in the history
… it isn't.
  • Loading branch information
xxxserxxx committed Feb 3, 2021
1 parent 024c01c commit 0373b9b
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions devices/temp_freebsd.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,16 @@ func devs() []string {
}
for k, _ := range sensorOIDS {
idx := strings.Index(string(bs), k)
if idx < 0 {
log.Printf(tr.Value("error.nodevfound", k))
} else {
if idx >= 0 {
rv = append(rv, k)
}
}
if len(rv) == 0 {
oids := make([]string, 0, len(sensorOIDS))
for k, _ := range sensorOIDS {
oids = append(oids, k)
}
log.Printf(tr.Value("error.nodevfound", strings.Join(oids, ", ")))
}
return rv
}

0 comments on commit 0373b9b

Please sign in to comment.