if you go into JAMF there is a script to block touch facebook, but it doesn't work.
I have look at the script, and I can't see anything wrong.
!/bin/bash
# swipely-host.sh
Check for certain entry in /etc/hosts
Add the entry if it's not found
Adam Codega, Swipely
Built off of http://thecodecave.com/2010/11/03/adding-a-line-to-etchosts-via-bash/
change domain to url you wish to block. subdomain would be www, m or anything else.
SUCCESS=0
domain=facebook.com
needle=touch.$domain
hostline="127.0.0.1 $needle"
filename=/etc/hosts
Determine if the line already exists in /etc/hosts
grep -q "$needle" "$filename" # -q is for quiet. Shhh...
Grep's return error code can then be checked. No error=success
if [ $? -eq $SUCCESS ]
then
exit 0;
else
# If the line wasn't found, add it using an echo append >>
echo "$hostline" >> "$filename"
# Let's recheck to be sure it was added.
grep -q "$needle" "$filename"
if [ $? -eq $SUCCESS ]
then
exit 0;
else
exit 1;
fi
fi
Help
Anne