From 478b380bbaad2a8be3cd9c35626745eb7c383b43 Mon Sep 17 00:00:00 2001 From: Roy Olav Purser Date: Sat, 23 Jul 2022 23:17:06 +0200 Subject: [PATCH] add force --- scripts/rotate.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/scripts/rotate.py b/scripts/rotate.py index 5f1255a..2eecbac 100755 --- a/scripts/rotate.py +++ b/scripts/rotate.py @@ -1,5 +1,6 @@ #!/usr/bin/env python3 from typing import Optional +import sys import subprocess import requests import pydantic @@ -64,7 +65,9 @@ def write_wg(server: Server, private_key: str): 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_wg(servers.current, servers.private_key) subprocess.run(["systemctl", "restart", "vpnclient-wg"], check=False)