You've already forked libdetectcloud
mirror of
https://github.com/netbirdio/libdetectcloud.git
synced 2026-05-22 17:09:55 -07:00
22 lines
349 B
Go
22 lines
349 B
Go
package libdetectcloud
|
|
|
|
import (
|
|
"io/ioutil"
|
|
"runtime"
|
|
"strings"
|
|
)
|
|
|
|
func detectOpenStack() string {
|
|
if runtime.GOOS != "windows" {
|
|
data, err := ioutil.ReadFile("/sys/class/dmi/id/sys_vendor")
|
|
if err != nil {
|
|
return ""
|
|
}
|
|
if strings.Contains(string(data), "OpenStack Foundation") {
|
|
return "OpenStack"
|
|
}
|
|
return ""
|
|
}
|
|
return ""
|
|
}
|