diff options
author | Rich Trott <rtrott@gmail.com> | 2021-03-20 21:53:47 +0300 |
---|---|---|
committer | Rich Trott <rtrott@gmail.com> | 2021-03-24 02:12:39 +0300 |
commit | f2090877f1f727020099ef9e30cc70e10b10f900 (patch) | |
tree | 2e6eeebb6e9da396d1ea6a4a008cebb5b9cab85a /tools | |
parent | 448158e0f87caec6fde76ee3c4aaf1da1c7aafc1 (diff) |
tools: improve macos-firewall.sh output
The output of tools/macos-firewall.sh can cause people to think it
didn't work. Update things slightly to make the output mildly more
informative.
Refs: https://github.com/nodejs/node/issues/37233#issuecomment-802201046
PR-URL: https://github.com/nodejs/node/pull/37846
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'tools')
-rwxr-xr-x | tools/macos-firewall.sh | 45 |
1 files changed, 17 insertions, 28 deletions
diff --git a/tools/macos-firewall.sh b/tools/macos-firewall.sh index 5a5ad52c285..b6050aaf345 100755 --- a/tools/macos-firewall.sh +++ b/tools/macos-firewall.sh @@ -21,36 +21,25 @@ CCTEST_DEBUG="$OUTDIR/Debug/cctest" OPENSSL_CLI_RELEASE="$OUTDIR/Release/openssl-cli" OPENSSL_CLI_DEBUG="$OUTDIR/Debug/openssl-cli" +add_and_unblock () { + if [ -e "$1" ] + then + echo Processing "$1" + $SFW --remove "$1" >/dev/null + $SFW --add "$1" + $SFW --unblock "$1" + fi +} + if [ -f $SFW ]; then - # Duplicating these commands on purpose as the symbolic link node might be - # linked to either out/Debug/node or out/Release/node depending on the - # BUILDTYPE. - $SFW --remove "$NODE_DEBUG" - $SFW --remove "$NODE_DEBUG" - $SFW --remove "$NODE_RELEASE" - $SFW --remove "$NODE_RELEASE" - $SFW --remove "$NODE_LINK" - $SFW --remove "$CCTEST_DEBUG" - $SFW --remove "$CCTEST_RELEASE" - $SFW --remove "$OPENSSL_CLI_DEBUG" - $SFW --remove "$OPENSSL_CLI_RELEASE" - - $SFW --add "$NODE_DEBUG" - $SFW --add "$NODE_RELEASE" - $SFW --add "$NODE_LINK" - $SFW --add "$CCTEST_DEBUG" - $SFW --add "$CCTEST_RELEASE" - $SFW --add "$OPENSSL_CLI_DEBUG" - $SFW --add "$OPENSSL_CLI_RELEASE" - - $SFW --unblock "$NODE_DEBUG" - $SFW --unblock "$NODE_RELEASE" - $SFW --unblock "$NODE_LINK" - $SFW --unblock "$CCTEST_DEBUG" - $SFW --unblock "$CCTEST_RELEASE" - $SFW --unblock "$OPENSSL_CLI_DEBUG" - $SFW --unblock "$OPENSSL_CLI_RELEASE" + add_and_unblock "$NODE_DEBUG" + add_and_unblock "$NODE_RELEASE" + add_and_unblock "$NODE_LINK" + add_and_unblock "$CCTEST_DEBUG" + add_and_unblock "$CCTEST_RELEASE" + add_and_unblock "$OPENSSL_CLI_DEBUG" + add_and_unblock "$OPENSSL_CLI_RELEASE" else echo "SocketFirewall not found in location: $SFW" fi |