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


Click here to return to the 'View firewall status via the Scripts menu' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
View firewall status via the Scripts menu
Authored by: kholburn on Aug 10, '06 10:45:33PM
How about this. It's a bit safer. You might also want to check for the existance of the file:

/Library/Preferences/com.apple.sharing.firewall
as well

tell application "Finder"
	try
		set plistPath to "/Library/Preferences/com.apple.sharing.firewall"
		set getValue to (do shell script "defaults  read " & plistPath & "  state")
		if getValue is equal to "0" then
			my setter("Firewall is ( off )")
		else if getValue is equal to "1" then
			my setter("Firewall is ( on )")
		end if
	on error
		my setter("Firewall ( UNKNOWN STATE )")
		return
	end try
	return
end tell

on setter(mymessage)
	if the name of me contains "Script" or the name of me contains "Editor" then
		display dialog mymessage buttons {"OK"}
	else
		set the name of (path to me) to mymessage
	end if
end setter



[ Reply to This | # ]