Alejandro Mery
1 year ago
1 changed files with 17 additions and 0 deletions
@ -0,0 +1,17 @@
|
||||
package zones |
||||
|
||||
// PruneWireguardConfig removes wgN.conf files of machines with
|
||||
// the corresponding ring disabled.
|
||||
func (z *Zone) PruneWireguardConfig(ring int) error { |
||||
var err error |
||||
|
||||
z.ForEachMachine(func(p *Machine) bool { |
||||
_, ok := p.getRingInfo(ring) |
||||
if !ok { |
||||
err = p.RemoveWireguardConfig(ring) |
||||
} |
||||
return err != nil |
||||
}) |
||||
|
||||
return err |
||||
} |
Loading…
Reference in new issue