Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Click here to return to the 'Lion solution' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Lion solution
Authored by: lhagan on Apr 16, '12 10:30:26PM
If you're looking for a way to control Lion's firewall using AppleScript, I put together a script that does exactly that. It's up on GitHub ( and here's the (MIT Licensed) code:

set getValue to do shell script "defaults read /Library/Preferences/ globalstate"
if getValue is less than "2" then
	display dialog "Switch firewall ON?" with icon caution
	do shell script "/usr/libexec/ApplicationFirewall/socketfilterfw --setglobalstate on --setblockall on" with administrator privileges
	display dialog "Switch firewall OFF?" with icon caution
	do shell script "/usr/libexec/ApplicationFirewall/socketfilterfw --setglobalstate off" with administrator privileges
end if
Based on an article by Charles Edge ( and a comment by 'dsanfili' (

[ Reply to This | # ]