added kernel name command
This commit is contained in:
parent
d41849e6f8
commit
275c50f0e9
2 changed files with 5 additions and 3 deletions
|
@ -45,8 +45,8 @@ func GetKernel() string {
|
||||||
return string(kernel)
|
return string(kernel)
|
||||||
}
|
}
|
||||||
|
|
||||||
func GetHostname() string {
|
func Unamebs(gamering string) string {
|
||||||
cmd := exec.Command("uname", "-n")
|
cmd := exec.Command("uname", gamering)
|
||||||
shell, _ := cmd.Output()
|
shell, _ := cmd.Output()
|
||||||
return strings.Replace(string(shell), "\n", "", -1)
|
return strings.Replace(string(shell), "\n", "", -1)
|
||||||
}
|
}
|
||||||
|
|
4
main.go
4
main.go
|
@ -65,7 +65,9 @@ func handlePrint(action, format string, rest string) {
|
||||||
no, _ := strconv.Atoi(data.GetUptime())
|
no, _ := strconv.Atoi(data.GetUptime())
|
||||||
utils.CutePrint(data.FormatTime(no), format)
|
utils.CutePrint(data.FormatTime(no), format)
|
||||||
case "hostname":
|
case "hostname":
|
||||||
utils.CutePrint(data.GetHostname(), format)
|
utils.CutePrint(data.Unamebs("-n"), format)
|
||||||
|
case "kernelname":
|
||||||
|
utils.CutePrint(data.Unamebs("-s"), format)
|
||||||
case "GPU":
|
case "GPU":
|
||||||
utils.CutePrint(data.GetGPU(), format)
|
utils.CutePrint(data.GetGPU(), format)
|
||||||
case "shell":
|
case "shell":
|
||||||
|
|
Loading…
Reference in a new issue