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.
This commit is contained in:
parent
5bfd82aa6b
commit
b60efb3f96
1 changed files with 2 additions and 1 deletions
|
@ -41,6 +41,7 @@ def main():
|
||||||
parser.add_argument("--location", type=str, required=True, help="Server location")
|
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("--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("--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()
|
args = parser.parse_args()
|
||||||
|
|
||||||
|
@ -48,7 +49,7 @@ def main():
|
||||||
location = args.location
|
location = args.location
|
||||||
server_type = args.server_type
|
server_type = args.server_type
|
||||||
interface = args.interface
|
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
|
# Step 1: Execute the existing script to set up the remote VPN server
|
||||||
new_peer_section = execute_script(provider, location, server_type)
|
new_peer_section = execute_script(provider, location, server_type)
|
||||||
|
|
Loading…
Reference in a new issue