add force
This commit is contained in:
parent
4e82aed651
commit
478b380bba
@ -1,5 +1,6 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
from typing import Optional
|
from typing import Optional
|
||||||
|
import sys
|
||||||
import subprocess
|
import subprocess
|
||||||
import requests
|
import requests
|
||||||
import pydantic
|
import pydantic
|
||||||
@ -64,7 +65,9 @@ def write_wg(server: Server, private_key: str):
|
|||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
if offline() and (servers := select_server()):
|
if ((len(sys.argv) == 2 and sys.argv[1] == "--force") or offline()) and (
|
||||||
|
servers := select_server()
|
||||||
|
):
|
||||||
write_json(servers)
|
write_json(servers)
|
||||||
write_wg(servers.current, servers.private_key)
|
write_wg(servers.current, servers.private_key)
|
||||||
subprocess.run(["systemctl", "restart", "vpnclient-wg"], check=False)
|
subprocess.run(["systemctl", "restart", "vpnclient-wg"], check=False)
|
||||||
|
Loading…
Reference in New Issue
Block a user