EA DNS Server "The networksetup binary is not present on this machine."

Craig_Whittaker
New Contributor III

Hello all,

Can I check if anyone else is getting "The networksetup binary is not present on this machine." using the DNS Server Extension Attribute ??

anyone found a fix?

Thanks
Craig W

5 REPLIES 5

davidacland
Honored Contributor II
Honored Contributor II

I haven't looked at the EA, but networksetup is on my Mac (10.13.3):

Mac:~ dave$ which networksetup
/usr/sbin/networksetup

Might be that the EA has a typo or is looking in the wrong location.

Craig_Whittaker
New Contributor III

Looks like that message is coming from the EA

else echo "<result>The networksetup binary is not present on this machine.</result>"

davidacland
Honored Contributor II
Honored Contributor II

Could you post a copy of the EA code?

Craig_Whittaker
New Contributor III

sure its the one from the templates in JSS

!/bin/sh

OS=/usr/bin/sw_vers -productVersion | /usr/bin/colrm 5
if [[ "$OS" < "10.5" ]]; then
if [ -f /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Support/networksetup ];then NetworkInterface=/System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Support/networksetup -listnetworkserviceorder 2>&1 | grep $(/usr/sbin/netstat -rn 2>&1 | /usr/bin/grep -m 1 'default' | /usr/bin/awk '{ print $6 }') | sed -e "s/.Port: //g" -e "s/,.//g" echo "<result>/System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Support/networksetup -getdnsservers "$NetworkInterface" 2>&1</result>"
else echo "<result>The networksetup binary is not present on this machine.</result>"
fi
else
NetworkInterface=/usr/sbin/networksetup -listnetworkserviceorder 2>&1 | grep $(/usr/sbin/netstat -rn 2>&1 | /usr/bin/grep -m 1 'default' | /usr/bin/awk '{ print $6 }') | sed -e "s/.Port: //g" -e "s/,.//g"
echo "<result>/usr/sbin/networksetup -getdnsservers "$NetworkInterface" 2>&1</result>"
fi

davidacland
Honored Contributor II
Honored Contributor II

A lot of the template EAs are quite old, and sometimes broken unfortunately.

It looks like the above EA is it's looking inside the ARDAgent.app for networksetup if the OS is lower than 10.5. I'm guessing in your case you're not running 10.5, in which case, the script is failing to read the OS correctly.

I would edit the code to remove that part.