Update WireguardConfiguration.py

This commit is contained in:
Donald Zou
2025-12-30 21:38:06 +08:00
parent a3058d2a28
commit dcaf5eff32

View File

@@ -847,12 +847,14 @@ class WireguardConfiguration:
try:
check = subprocess.check_output(f"{self.Protocol}-quick down {self.Name}",
shell=True, stderr=subprocess.STDOUT)
print(check.decode())
self.removeAutostart()
except subprocess.CalledProcessError as exc:
return False, str(exc.output.strip().decode("utf-8"))
else:
try:
check = subprocess.check_output(f"{self.Protocol}-quick up {self.Name}", shell=True, stderr=subprocess.STDOUT)
print(check.decode())
self.addAutostart()
except subprocess.CalledProcessError as exc:
return False, str(exc.output.strip().decode("utf-8"))