Add PowerShell script to activate WireGuard profile
This commit is contained in:
@@ -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
|
||||
Reference in New Issue
Block a user