From b60efb3f96870a002858ba770ff8cfb43a4bd865 Mon Sep 17 00:00:00 2001 From: Kumi Date: Thu, 18 Jul 2024 18:37:56 +0200 Subject: [PATCH] feat: add optional config path argument to script Introduced a `--config_path` parameter to allow specifying a custom path for the Wireguard configuration file. Defaults to `/etc/wireguard/{interface}.conf` if not provided. This enhances flexibility for different deployment environments and use cases. --- update_local_config.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/update_local_config.py b/update_local_config.py index a5ca399..4807c43 100644 --- a/update_local_config.py +++ b/update_local_config.py @@ -41,6 +41,7 @@ def main(): parser.add_argument("--location", type=str, required=True, help="Server location") parser.add_argument("--server_type", type=str, required=True, help="Server type") parser.add_argument("--interface", type=str, required=True, help="Wireguard interface (e.g., wg0)") + parser.add_argument("--config_path", type=str, help="Path to the Wireguard configuration file") args = parser.parse_args() @@ -48,7 +49,7 @@ def main(): location = args.location server_type = args.server_type interface = args.interface - config_path = f"/etc/wireguard/{interface}.conf" + config_path = args.config_path or f"/etc/wireguard/{interface}.conf" # Step 1: Execute the existing script to set up the remote VPN server new_peer_section = execute_script(provider, location, server_type)