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: try:
check = subprocess.check_output(f"{self.Protocol}-quick down {self.Name}", check = subprocess.check_output(f"{self.Protocol}-quick down {self.Name}",
shell=True, stderr=subprocess.STDOUT) shell=True, stderr=subprocess.STDOUT)
print(check.decode())
self.removeAutostart() self.removeAutostart()
except subprocess.CalledProcessError as exc: except subprocess.CalledProcessError as exc:
return False, str(exc.output.strip().decode("utf-8")) return False, str(exc.output.strip().decode("utf-8"))
else: else:
try: try:
check = subprocess.check_output(f"{self.Protocol}-quick up {self.Name}", shell=True, stderr=subprocess.STDOUT) check = subprocess.check_output(f"{self.Protocol}-quick up {self.Name}", shell=True, stderr=subprocess.STDOUT)
print(check.decode())
self.addAutostart() self.addAutostart()
except subprocess.CalledProcessError as exc: except subprocess.CalledProcessError as exc:
return False, str(exc.output.strip().decode("utf-8")) return False, str(exc.output.strip().decode("utf-8"))