Merge pull request #520 from clong/try_catch_ping

Add exception handling for ping.detectionlab.network requests
This commit is contained in:
Chris Long
2020-09-20 21:14:08 -07:00
committed by GitHub
2 changed files with 6 additions and 2 deletions

View File

@@ -517,7 +517,7 @@ postinstall_tasks() {
echo export PATH="$PATH:/opt/splunk/bin:/opt/zeek/bin" >>~/.bashrc
echo "export SPLUNK_HOME=/opt/splunk" >>~/.bashrc
# Ping DetectionLab server for usage statistics
curl -s -A "DetectionLab-logger" "https:/ping.detectionlab.network/logger"
curl -s -A "DetectionLab-logger" "https:/ping.detectionlab.network/logger" || echo "Unable to connect to ping.detectionlab.network"
}
main() {

View File

@@ -21,7 +21,11 @@ If (!(Test-Path $ProfilePath)) {
}
# Ping DetectionLab server for usage statistics
curl -userAgent "DetectionLab-$box" "https://ping.detectionlab.network/$box" -UseBasicParsing | out-null
Try {
curl -userAgent "DetectionLab-$box" "https://ping.detectionlab.network/$box" -UseBasicParsing | out-null
} Catch {
Write-Host "Unable to connect to ping.detectionlab.network"
}
Write-Host "$('[{0:HH:mm}]' -f (Get-Date)) Disabling IPv6 on all network adatpers..."
Get-NetAdapterBinding -ComponentID ms_tcpip6 | ForEach-Object {Disable-NetAdapterBinding -Name $_.Name -ComponentID ms_tcpip6}