diff --git a/host/host_linux.go b/host/host_linux.go index 0e09f15..7ca5089 100644 --- a/host/host_linux.go +++ b/host/host_linux.go @@ -319,6 +319,12 @@ func PlatformInformationWithContext(ctx context.Context) (platform string, famil if err == nil { version = getRedhatishVersion(contents) } + } else if common.PathExists(common.HostEtc("slackware-version")) { + platform = "slackware" + contents, err := common.ReadLines(common.HostEtc("slackware-version")) + if err == nil { + version = getSlackwareVersion(contents) + } } else if common.PathExists(common.HostEtc("debian_version")) { if lsb.ID == "Ubuntu" { platform = "ubuntu" @@ -441,6 +447,12 @@ func KernelVersionWithContext(ctx context.Context) (version string, err error) { return version, nil } +func getSlackwareVersion(contents []string) string { + c := strings.ToLower(strings.Join(contents, "")) + c = strings.Replace(c, "slackware ", "", 1) + return c +} + func getRedhatishVersion(contents []string) string { c := strings.ToLower(strings.Join(contents, ""))