From 65bbdfdd837daa46bd561f6bf8c4f8a64d4d33f2 Mon Sep 17 00:00:00 2001 From: Pete Wright Date: Fri, 20 Nov 2020 13:29:21 -0800 Subject: [PATCH] Fix FreeBSD $OSTYPE check As per this bug report: https://github.com/toniblyx/prowler/issues/693 Add detection for freebsd releases which should be similar to darwin in that it will use GNU coreutils for date and base64. --- include/os_detector | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/os_detector b/include/os_detector index af962d4c..023d47ea 100644 --- a/include/os_detector +++ b/include/os_detector @@ -154,7 +154,7 @@ if [ "$OSTYPE" == "linux-gnu" ] || [ "$OSTYPE" == "linux-musl" ]; then test_tcp_connectivity() { gnu_test_tcp_connectivity "$1" "$2" "$3" } -elif [[ "$OSTYPE" == "darwin"* ]]; then +elif [[ "$OSTYPE" == "darwin"* ]] || [[ "$OSTYPE" == "freebsd"* ]]; then # BSD/OSX commands compatibility TEMP_REPORT_FILE=$(mktemp -t prowler.cred_report-XXXXXX) # It is possible that the user has installed GNU coreutils on OS X. By default, this will make GNU commands