mirror of https://github.com/aredn/aredn.git
Accidenally created the wireguard devices twice (#1036)
This commit is contained in:
parent
0899ae7d02
commit
2fe3904f0a
|
@ -549,16 +549,6 @@ if not nixio.fs.stat("/usr/bin/wg") then
|
|||
wgclients = 0
|
||||
wgservers = 0
|
||||
end
|
||||
if wgclients + wgservers > 0 then
|
||||
local maxwgservers = math.min(10 * math.ceil(wgservers / 10), nixio.bit.lshift(1, 32 - tonumber(cm:get("wireguard", "@wireguard_server[0]", "masksize") or 26)))
|
||||
cfg.tun_devices_config = cfg.tun_devices_config ..
|
||||
string.format("config interface 'wgc'\n\toption ifname 'wgc'\n\toption proto 'none'\n\n")
|
||||
for dev = 0, maxwgservers - 1
|
||||
do
|
||||
cfg.tun_devices_config = cfg.tun_devices_config ..
|
||||
string.format("config interface 'wgs%d'\n\toption ifname 'wgs%d'\n\toption proto 'none'\n\n", dev, dev)
|
||||
end
|
||||
end
|
||||
|
||||
remove_all("/tmp/new_config")
|
||||
nixio.fs.mkdir("/tmp/new_config")
|
||||
|
|
Loading…
Reference in New Issue