diff --git a/macOS/scripts/postinstall b/macOS/scripts/postinstall
index 42b00a4f2bfb76bd31e885d11bb6be389a4da44a..0c6e3e5923c936a08c68c5b772d62cc80be1ba2b 100755
--- a/macOS/scripts/postinstall
+++ b/macOS/scripts/postinstall
@@ -1,6 +1,6 @@
 #!/usr/bin/env bash
 
-# Copyright © 2019-2020 Dynare Team
+# Copyright © 2019-2021 Dynare Team
 #
 # This file is part of Dynare.
 #
@@ -29,12 +29,11 @@ exec 2>&1
 rm -f "$2"/dummy
 
 # Test for Internet connection
-[[ -z $(curl -s -m 4 https://github.com) ]] && \
-    { \
-      osascript -e 'display alert "Dynare Installation Error" message "Not able to connect to github.com. Either you are not connected to the internet or github.com is blocked where you are.\n\nAccess to GitHub is necessary to make Dynare work with the `use_dll` option on macOS.\n\nIf you cannot establish this connection or do not want to use the `use_dll` option of Dynare, please run the installer again and choose \"Customize\" from the \"Installation Type\" screen and uncheck the `GCC` option." as critical'; \
-      echo "No internet connection to github.com"; \
-      exit 1; \
-    }
+if ! curl -s -m 4 https://github.com >/dev/null; then
+    osascript -e 'display alert "Dynare Installation Error" message "Not able to connect to github.com. Either you are not connected to the internet or github.com is blocked where you are.\n\nAccess to GitHub is necessary to make Dynare work with the `use_dll` option on macOS.\n\nIf you cannot establish this connection or do not want to use the `use_dll` option of Dynare, please run the installer again and choose \"Customize\" from the \"Installation Type\" screen and uncheck the `GCC` option." as critical'
+    echo "No internet connection to github.com"
+    exit 1
+fi
 
 # Install Command Line Tools
 if [[ -z $(/usr/bin/xcode-select -print-path) ]]; then