Posted on 07-29-2010 04:47 PM
An error occurred executing the policy "PostImage: Install Sophos, Mail cert. DUPLICATE" on the computer "2448-mp".
Hello All.
I'm just working at automating my imaging more and am running into an issue which I'm not sure how to solve.
Essentially I call a script via the jamf command and a custom trigger. That runs fine, but I get this output in a failure notice:
Event log from the policy:
/usr/sbin/jamf is version 7.3 Executing Policy PostImage: Install Sophos, Mail cert. DUPLICATE... Mounting afp://xserve2.hadw.com/CasperShare to /Volumes/CasperShare... Caching package... Copying Sophos AA Remove Anti-Virus.pkg... Installing Sophos AA Remove Anti-Virus.pkg... Successfully installed Sophos AA Remove Anti-Virus.pkg. Caching package... Installing Sophos Anti-Virus.mpkg... Successfully installed Sophos Anti-Virus.mpkg. Installing com.hadw.mail_cert.pkg... Successfully installed com.hadw.mail_cert.pkg. Running Script setsoftwareupdate.sh... Script Exit Code:0 Script Result: Thu Jul 29 16:23:27 2448-mp.local system_profiler[2082] <Warning>: 3891612: (connectAndCheck) Untrusted apps are not allowed to connect to or launch Window Server before login. Thu Jul 29 16:23:27 2448-mp.local system_profiler[2082] <Error>: kCGErrorFailure: Set a breakpoint @ CGErrorBreakpoint() to catch errors as they are logged.
It appears that the setsoftwareupdate.sh is causing warning. Probably the system_profiler command doesn't work when jamf is running the command. Anyone know of a way to get the model without using system_profiler. Is that what is causing the error?
Thanks!
Aaron
--------------------------
#!/bin/bash
#script ported from AppleScript to shell by feyd
#original by flammable found here http://www.macosxhints.com/article.php?story091002190708159
#modified by Aaron to only set SWupdate for non-laptop models.
osVersion=sw_vers -productVersion
macModel=system_profiler | grep -i "model name" | sed -n 's/[^:]*://p' | sed -e 's/^ *//'
if [[ "$macModel" == *Book* ]]; then # Dont change any iBook, MacBook, MacBook Pro etc.
logger -i "setsoftwareupdate.sh is detecting $macModel, a Macbook. Leaving SWupdate set to Apple."
echo "setsoftwareupdate.sh is leaving SWupdate set to Apple."
exit 99
else
case $osVersion in
10.4)
catalogURLValue="http://xserve2:8088/index.sucatalog"
;;
10.5)
catalogURLValue="http://xserve2:8088/index-leopard.merged-1.sucatalog"
;;
10.6)
catalogURLValue="http://xserve2:8088/index-leopard-snowleopard.merged-1.sucatalog"
;;
10.[1-3])
exit 1
;;
esac
#write the update server
defaults write /Library/Preferences/com.apple.SoftwareUpdate CatalogURL $catalogURLValue
fi
exit 0
-----------------------------------------------------------------