mirror of
https://github.com/donaldzou/WGDashboard.git
synced 2025-07-13 08:36:59 +00:00
Update dashboard.py
This commit is contained in:
parent
7b59149f90
commit
6a88959ec4
@ -1580,7 +1580,7 @@ class Peer:
|
|||||||
f.write(preshared_key)
|
f.write(preshared_key)
|
||||||
newAllowedIPs = allowed_ip.replace(" ", "")
|
newAllowedIPs = allowed_ip.replace(" ", "")
|
||||||
updateAllowedIp = subprocess.check_output(
|
updateAllowedIp = subprocess.check_output(
|
||||||
f"{self.configuration.Protocol} set {self.configuration.Name} peer {self.id} allowed-ips {newAllowedIPs}{f' preshared-key {uid}' if pskExist else ''}",
|
f"{self.configuration.Protocol} set {self.configuration.Name} peer {self.id} allowed-ips {newAllowedIPs} {f'preshared-key {uid}' if pskExist else 'preshared-key /dev/null'}",
|
||||||
shell=True, stderr=subprocess.STDOUT)
|
shell=True, stderr=subprocess.STDOUT)
|
||||||
|
|
||||||
if pskExist: os.remove(uid)
|
if pskExist: os.remove(uid)
|
||||||
@ -1743,7 +1743,7 @@ PersistentKeepalive = {str(self.keepalive)}
|
|||||||
f.write(preshared_key)
|
f.write(preshared_key)
|
||||||
newAllowedIPs = allowed_ip.replace(" ", "")
|
newAllowedIPs = allowed_ip.replace(" ", "")
|
||||||
updateAllowedIp = subprocess.check_output(
|
updateAllowedIp = subprocess.check_output(
|
||||||
f"{self.configuration.Protocol} set {self.configuration.Name} peer {self.id} allowed-ips {newAllowedIPs}{f' preshared-key {uid}' if pskExist else ''} advanced-security {advanced_security}",
|
f"{self.configuration.Protocol} set {self.configuration.Name} peer {self.id} allowed-ips {newAllowedIPs} {f'preshared-key {uid}' if pskExist else 'preshared-key /dev/null'} advanced-security {advanced_security}",
|
||||||
shell=True, stderr=subprocess.STDOUT)
|
shell=True, stderr=subprocess.STDOUT)
|
||||||
|
|
||||||
if pskExist: os.remove(uid)
|
if pskExist: os.remove(uid)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user