mirror of
https://github.com/gravitl/netmaker.git
synced 2025-10-05 08:47:35 +08:00
random ID for comms nodes
This commit is contained in:
@@ -97,11 +97,10 @@ func JoinNetwork(cfg config.ClientConfig, privateKey string, iscomms bool) error
|
|||||||
privateKey = wgPrivatekey.String()
|
privateKey = wgPrivatekey.String()
|
||||||
cfg.Node.PublicKey = wgPrivatekey.PublicKey().String()
|
cfg.Node.PublicKey = wgPrivatekey.PublicKey().String()
|
||||||
}
|
}
|
||||||
|
|
||||||
// Find and set node MacAddress
|
// Find and set node MacAddress
|
||||||
if cfg.Node.MacAddress == "" {
|
if cfg.Node.MacAddress == "" {
|
||||||
macs, err := ncutils.GetMacAddr()
|
macs, err := ncutils.GetMacAddr()
|
||||||
if err != nil {
|
if err != nil || iscomms {
|
||||||
//if macaddress can't be found set to random string
|
//if macaddress can't be found set to random string
|
||||||
cfg.Node.MacAddress = ncutils.MakeRandomString(18)
|
cfg.Node.MacAddress = ncutils.MakeRandomString(18)
|
||||||
} else {
|
} else {
|
||||||
|
Reference in New Issue
Block a user