Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tools: improve macos-firewall.sh output #37846

Merged
merged 1 commit into from
Mar 23, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 17 additions & 28 deletions tools/macos-firewall.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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