Skip to content

Commit

Permalink
windows: install_firefox.ps1: add check for internet
Browse files Browse the repository at this point in the history
  • Loading branch information
Kajal4414 authored Jun 19, 2024
1 parent e6ca80b commit 5dce23e
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Windows/Software/install_firefox.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@ if (-not (New-Object Security.Principal.WindowsPrincipal([Security.Principal.Win
PauseNull
}

if (-not (Test-Connection 8.8.8.8 -Count 1 -Quiet)) {
Write-Host "Error: Internet connection required." -ForegroundColor Red
PauseNull
}

function DownloadFile($url, $path) {
curl.exe -o $path -LSs $url
Write-Host "Downloaded: $path" -ForegroundColor Green
Expand Down

0 comments on commit 5dce23e

Please sign in to comment.