mirror of
https://github.com/donaldzou/WGDashboard.git
synced 2025-10-03 15:56:17 +00:00
Fixed issue #352
Fixed issue when allowed_ips have more than 1 IP Address, allow access will crash
This commit is contained in:
@@ -697,7 +697,7 @@ class WireguardConfiguration:
|
||||
with open(f"{uid}", "w+") as f:
|
||||
f.write(p['preshared_key'])
|
||||
|
||||
subprocess.check_output(f"wg set {self.Name} peer {p['id']} allowed-ips {p['allowed_ip']}{f' preshared-key {uid}' if presharedKeyExist else ''}",
|
||||
subprocess.check_output(f"wg set {self.Name} peer {p['id']} allowed-ips {p['allowed_ip'].replace(' ', '')}{f' preshared-key {uid}' if presharedKeyExist else ''}",
|
||||
shell=True, stderr=subprocess.STDOUT)
|
||||
if presharedKeyExist: os.remove(str(uid))
|
||||
else:
|
||||
|
Reference in New Issue
Block a user