mirror of
https://github.com/donaldzou/WGDashboard.git
synced 2025-09-07 20:21:15 +00:00
Update dashboard.py
This commit is contained in:
@@ -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)
|
||||||
|
Reference in New Issue
Block a user