This commit is contained in:
TenderIronh
2022-02-10 23:20:16 +08:00
parent 133fe046f8
commit b54fa2c6be
18 changed files with 32 additions and 22 deletions
+10
View File
@@ -7,8 +7,10 @@ import (
"crypto/tls"
"encoding/json"
"fmt"
"math/rand"
"net"
"net/http"
"os"
"os/exec"
"time"
)
@@ -148,3 +150,11 @@ func execOutput(name string, args ...string) string {
cmdGetOsName.Run()
return cmdOut.String()
}
func defaultNodeName() string {
name, _ := os.Hostname()
for len(name) < 8 {
name = fmt.Sprintf("%s%d", name, rand.Int()%10)
}
return name
}