Accidenally created the wireguard devices twice (#1036)

This commit is contained in:
Tim Wilkinson 2023-12-19 16:13:26 -08:00 committed by GitHub
parent 0899ae7d02
commit 2fe3904f0a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 0 additions and 10 deletions

View File

@ -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")