mirror of
https://github.com/oneclickvirt/basics.git
synced 2025-10-09 10:30:39 +08:00
update
This commit is contained in:
@@ -6,6 +6,7 @@ import (
|
|||||||
"os"
|
"os"
|
||||||
"os/exec"
|
"os/exec"
|
||||||
"runtime"
|
"runtime"
|
||||||
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/libp2p/go-nat"
|
"github.com/libp2p/go-nat"
|
||||||
@@ -17,7 +18,7 @@ func getVmTypeFromSDV(path string) string {
|
|||||||
cmd := exec.Command(fmt.Sprintf("%s/systemd-detect-virt", path))
|
cmd := exec.Command(fmt.Sprintf("%s/systemd-detect-virt", path))
|
||||||
output, err := cmd.Output()
|
output, err := cmd.Output()
|
||||||
if err == nil {
|
if err == nil {
|
||||||
switch string(output) {
|
switch strings.TrimSpace(strings.ReplaceAll(string(output), "\n", "")) {
|
||||||
case "kvm":
|
case "kvm":
|
||||||
return "KVM"
|
return "KVM"
|
||||||
case "xen":
|
case "xen":
|
||||||
@@ -115,6 +116,8 @@ func getHostInfo() (string, string, string, string, string, string, string, stri
|
|||||||
if err == nil {
|
if err == nil {
|
||||||
natType := gateway.Type()
|
natType := gateway.Type()
|
||||||
NatType = natType
|
NatType = natType
|
||||||
|
} else {
|
||||||
|
fmt.Println(err.Error())
|
||||||
}
|
}
|
||||||
// 获取当前系统的本地时区
|
// 获取当前系统的本地时区
|
||||||
CurrentTimeZone = utils.GetTimeZone()
|
CurrentTimeZone = utils.GetTimeZone()
|
||||||
|
Reference in New Issue
Block a user