Posted on 04-13-2015 09:16 AM
I’m tightening a few things down and was searching across JAMF Nation for a resolve in 10.10.2, specifically with finding a script on enabling the firewall. I ran across this script which seemed to bit quite a bit older and created by a couple of techs, obviously this was written while functioning under an older OS:
function firewall { #Reads the current state of the firewall and stores it in variable fw fw=$(defaults read /Library/Preferences/com.apple.alf globalstate)
#This compares the option passed to function firewall to its current state.
if [ "$1" != "$fw" ]
then
#If the option pased is different from current state, it changes it to the passed value.
defaults write /Library/Preferences/com.apple.alf globalstate -int $1
#For troubleshooting purposes, you can put in 'say $1' to see which state is being set.
fi
}
if test -e /var/run/resolv.conf then #This stores the domain line of resolv.conf into variable NETWORK. NETWORK=$(cat /var/run/resolv.conf | grep domain | awk '{print $2}')
#This case looks at $NETWORK for specific domains and runs commands accordingly case "$NETWORK" in
#If on VPN, function firewall turns the firewall on. vpn.yourcompany.com firewall 1 ;;
#On any other company domain, function firewall turns firewall off. *.yourcompany.com) firewall 0 ;;
#On any other domain, function firewall turns firewall on. *) firewall 1 ;;
esac
else #If no network connection exists, function firewall turns the firewall on. firewall 1
fi
This seems to be a better fix: https://jamfnation.jamfsoftware.com/discussion.html?id=13874
Anyone have a better resolve under 10.10.2?
Solved! Go to Solution.
Posted on 04-22-2015 10:07 AM
Got it working with:
defaults write /Library/Preferences/com.apple.alf global state -int -1
Posted on 04-13-2015 09:25 AM
Posted on 04-22-2015 10:07 AM
Got it working with:
defaults write /Library/Preferences/com.apple.alf global state -int -1