From 10c6b802e6248443cde60c9d85769252935e6926 Mon Sep 17 00:00:00 2001 From: egutierrez Date: Mon, 25 Nov 2024 01:17:00 +0100 Subject: [PATCH] Add PowerShell script to activate WireGuard profile --- activar_wireguard.ps1 | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 activar_wireguard.ps1 diff --git a/activar_wireguard.ps1 b/activar_wireguard.ps1 new file mode 100644 index 0000000..9735811 --- /dev/null +++ b/activar_wireguard.ps1 @@ -0,0 +1,23 @@ +# Ruta completa del archivo de configuración del perfil (incluye .conf) +$wgProfileName = "C:\Program Files\WireGuard\homer-france-Solo-ip10.conf" + +# Ruta al ejecutable de WireGuard +$wireguardExe = "C:\Program Files\WireGuard\wireguard.exe" + +# Verifica si WireGuard está instalado +if (-Not (Test-Path $wireguardExe)) { + Write-Host "WireGuard no está instalado o el ejecutable no se encuentra en: $wireguardExe" -ForegroundColor Red + exit +} + +# Verifica si el archivo de configuración del perfil existe +if (-Not (Test-Path $wgProfileName)) { + Write-Host "No se encontró el archivo de configuración en: $wgProfileName" -ForegroundColor Red + exit +} + +# Activa el perfil de WireGuard +Start-Process -FilePath $wireguardExe -ArgumentList "/installtunnelservice `"$wgProfileName`"" -Wait + +# Confirmación +Write-Host "Perfil de WireGuard activado: $wgProfileName" -ForegroundColor Green