Skip to main content

Has anyone here successfully configured Securly to work in their OS X environment. We are testing it for a possible future purchase and have gotten it to work with the iPads and Chromebooks. I followed their instructions from a conference call, adding their DNS forwarders to our DNS server, editing their uswest_OSXDNS.sh script to add our DNS server address, creating a Configuration Profile with their self signed .der file, and a Policy to run their uswest_OSXDNS.sh script during startup, login, logout, network state change.



The Configuration Profile installs, but the scrip policy fails. The error we get in the policy is:



Our script consists of the following information (the IPs have been removed for security):



!/bin/bash



servers=“###.###.###.### ###.###.###.###"
networksetup -listallnetworkservices | sed 1d $file | while read adapter
do
networksetup -setdnsservers "$adapter" $servers
networksetup -setv6off "$adapter"
done
dscacheutil -flushcache
exit 0



We are not getting a whole lot of help from Securly on this. Anybody else who has gotten this to work have any ideas?



Thanks! Mike

servers=“###.###.###.### ###.###.###.###"


Those are different types of double quotes, maybe replace that first one.


We have it functioning quite well in our environment. We have multiple buildings that have different DNS servers so I have a policy for each building and then use the parameters within each policy to set the DNS settings. Here is our script:



#!/bin/sh
####################################################################################################
#
# Description: This script sets DNS in order to provide secURLy filtering
#
# Creation Date: 05/16/16
# Modification Dates and Description of changes:
#
# Version 1.0 - Initial Script Creation
#
####################################################################################################

# DNS settings are passed to the script via parameter.
# This script can support up to 8 DNS settings provided via sequential parameters



# Detects all network hardware & creates services for all installed network hardware
/usr/sbin/networksetup -detectnewhardware

#Loops through the list of network services
# for i in $(networksetup -listallnetworkservices | tail +2 );
# do
# networksetup -setdnsservers $i "Empty"
# done

dscacheutil -flushcache
killall -HUP mDNSResponder

IFS=$'
'

#Loops through the list of network services
for i in $(networksetup -listallnetworkservices | tail +2 );
do
networksetup -setdnsservers "$i" "$4" "$5" "$6" "$7"
done

unset IFS


As a side note we have had big issues with the securly certificate and Firefox. Especially since Firefox Quantum has been released. Safari and Google both use the system certs and have no issue finding securly. Firefox does not...



Hope this helps,



David


From the log I feel like you might have the wrong script in jamf or posted the wrong one here. The errors read



Line 6: unexpected EOF while looking for matching `"'

and

Line 10: syntax error unexpected EOF


Line 6 doesn't have a ` " or '. On top of that none of the lines had single quotes or ticks in them.



!/bin/bash
servers=“###.###.###.### ###.###.###.###"
networksetup -listallnetworkservices | sed 1d $file | while read adapter
do networksetup -setdnsservers "$adapter" "$servers" networksetup -setv6off "$adapter"
done
dscacheutil -flushcache
exit 0


Also please post code using the ">_" button. It makes it easier for us to look through.


I think @alexjdale was correct now that it's in that format. Green text is supposed to be inside double quotes and it's starting at the end of your IP's. That first set of double quotes must be weird. I would just open the script in text edit, or in the "scripts" section of the Jamf settings and delete the first double quotes and replace them.


Thanks, Everyone! The first double quotes were what screwed it up. That was exactly what I got from Securly and their support didn't see the problem. Thanks for the extra set of eyes!


Crashplan pro e had a smart quote in a bash script a few years ago too. smart quotes ruin everything unless you are a journalist.