mirror of
https://github.com/netbirdio/netbird.git
synced 2026-04-19 16:56:39 +00:00
Extend the system informations
This commit is contained in:
17
client/system/reboot.go
Normal file
17
client/system/reboot.go
Normal file
@@ -0,0 +1,17 @@
|
||||
package system
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"github.com/shirou/gopsutil/host"
|
||||
log "github.com/sirupsen/logrus"
|
||||
)
|
||||
|
||||
func lastReboot() string {
|
||||
info, err := host.Info()
|
||||
if err != nil {
|
||||
log.Errorf("failed to get boot time: %s", err)
|
||||
return ""
|
||||
}
|
||||
return time.Unix(int64(info.BootTime), 0).String()
|
||||
}
|
||||
Reference in New Issue
Block a user