Hi all
We have an EA in place to retreive the Apple update server CatalogURL that's set on each Mac,
it works consistantly on all our 10.9 machines but i'm getting incosistent results from 10.10 and 10.11 machines.
We're pushing out the CatalogURL in a computer level Configuration Profile so it adds the CatalogURL to /Library/Managed Preferences/com.apple.SoftwareUpdate.plist and
not to /Library/Preferences or /var/root/Library/Preferences
If i run jamf recon the EA reports back with no result on about half of the machines if i then run the command directly on that Mac in terminal (the plist definitely has a CatalogURL key within it)
As root
defaults read /Library/Managed Preferences/com.apple.SoftwareUpdate CatalogURL
i get
Segmentation fault: 11
as admin
sudo defaults read /Library/Managed Preferences/com.apple.SoftwareUpdate CatalogURL
i get
no result
as admin without sudo
defaults read /Library/Managed Preferences/com.apple.SoftwareUpdate CatalogURL
i either get the CatalogURL successfully on some machines and get Segmentation fault: 11 on others
it seems to be permission related as i can copy the plist to the Desktop and read from it ok from there. As this is running as root in an EA is there anything i need to be aware of to make this work 100% on 10.10 and 10.11 ?
here's the EA
#!/bin/sh
if [ -f /Library/Managed Preferences/com.apple.SoftwareUpdate.plist ]; then
SWU=`defaults read /Library/Managed Preferences/com.apple.SoftwareUpdate CatalogURL`
echo "<result>$SWU</result>"
else
echo "<result>No managed plist</result>"
fi