Created
July 20, 2016 14:32
-
-
Save jstoiko/b175d2df35924e8b0f647e206c4d9dcb to your computer and use it in GitHub Desktop.
Turn OS X firewall on/off from the command-line (and refresh BitBar)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
socketfilterfw=/usr/libexec/ApplicationFirewall/socketfilterfw | |
if [[ "$1" == on ]]; then | |
sudo $socketfilterfw --setglobalstate on | |
sudo $socketfilterfw --setblockall on | |
open -g bitbar://refreshPlugin?name=firewall.*?.sh | |
elif [[ "$1" == off ]]; then | |
sudo $socketfilterfw --setglobalstate off | |
open -g bitbar://refreshPlugin?name=firewall.*?.sh | |
else | |
echo "whatsup?" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment