mirror of
https://github.com/psviderski/uncloud.git
synced 2026-08-28 12:03:33 +00:00
feat(machine): add OS and kernel version information to machine info, show in 'machine ls'
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
package osinfo
|
||||
|
||||
import "golang.org/x/sys/unix"
|
||||
|
||||
// KernelVersion returns the running Linux kernel release, e.g. "6.8.0-31-generic".
|
||||
func KernelVersion() string {
|
||||
var un unix.Utsname
|
||||
if err := unix.Uname(&un); err != nil {
|
||||
return ""
|
||||
}
|
||||
return unix.ByteSliceToString(un.Release[:])
|
||||
}
|
||||
Reference in New Issue
Block a user