Fixes #152, missing thermal device on FreeBSD reported as error, when it isn't.

This commit is contained in:
Sean E. Russell 2021-02-03 15:24:56 -06:00
parent 024c01c49a
commit 0373b9b8d6

View File

@ -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
}