mirror of
https://github.com/tim-beatham/smegmesh.git
synced 2024-12-13 01:50:53 +01:00
16 lines
318 B
Go
16 lines
318 B
Go
|
package mesh
|
||
|
|
||
|
import "github.com/tim-beatham/wgmesh/pkg/hosts"
|
||
|
|
||
|
func AddAliases(meshid string, snapshot MeshSnapshot) {
|
||
|
hosts := hosts.NewHostsManipulator(meshid)
|
||
|
|
||
|
for _, node := range snapshot.GetNodes() {
|
||
|
if node.GetAlias() != "" {
|
||
|
hosts.AddAddr(node.GetWgHost().IP, node.GetAlias())
|
||
|
}
|
||
|
}
|
||
|
|
||
|
hosts.Write()
|
||
|
}
|