Skip to content

Commit

Permalink
Windows check tar (#36)
Browse files Browse the repository at this point in the history
* add check tar

* add check tar

* fix
  • Loading branch information
ShiranAvidov authored Oct 26, 2022
1 parent eb93454 commit 4998bfd
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
19 changes: 19 additions & 0 deletions Localhost/Windows/System/prerequisites/windows/functions.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -79,3 +79,22 @@ function Test-CanLocalhostConnectToLogzioMetrics {
Write-Run "Write-Error `"prerequisites.ps1 (2): localhost cannot connect to Logz.io logs. please check your network for port 8053`""
return 2
}

# Checks if tar is installed
# Error:
# Exit Code 3
function Test-IsTarInstalled {
. $using:logzioTempDir\utils_functions.ps1
$local:logFile = $using:logFile
$local:runFile = $using:runFile

Write-Log "INFO" "Checking if tar is installed ..."

Get-Command tar 2>&1 | Out-Null
if ($?) {
return
}

Write-Run "Write-Error `"prerequisites.ps1 (3): tar is not installed. please install it and rerun the agent script`""
return 3
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,8 @@ Invoke-Task "Test-CanLocalhostConnectToLogzioLogs" "checking if localhost can co
# Check if localhost can connect to Logz.io metrics (port 8053)
Invoke-Task "Test-CanLocalhostConnectToLogzioMetrics" "checking if localhost can connect to Logz.io metrics"

# Check if tar is installed
Invoke-Task "Test-IsTarInstalled" "checking if tar is installed"

# Finished successfully
Exit 0

0 comments on commit 4998bfd

Please sign in to comment.