Skip to main content
Solved

Extension Attribute Help

  • November 9, 2012
  • 2 replies
  • 20 views

Forum|alt.badge.img+16

I am trying to create an extension attribute that detects the presence of an installer package cached in the Waiting Room. I can run the script manually in terminal and get a true or false result. When I place the script in the extension attribute, I get no result returned. The script:

if [ -e /Library/Application Support/JAMF/Waiting Room/*.pkg.cache.xml ] then echo "true" else echo "false"
fi

What am I doing wrong?

Best answer by stevewood

Your echo statements need to be like this:

echo "<result>true</result>"

You're missing the <result></result> tags. So your script would be:

#!/bin/sh
if [ -e /Library/Application Support/JAMF/Waiting Room/*.pkg.cache.xml ]
then
echo "<result>true</result>"
else
echo "<result>false</result>"
fi

2 replies

stevewood
Forum|alt.badge.img+38
  • Hall of Fame
  • Answer
  • November 9, 2012

Your echo statements need to be like this:

echo "<result>true</result>"

You're missing the <result></result> tags. So your script would be:

#!/bin/sh
if [ -e /Library/Application Support/JAMF/Waiting Room/*.pkg.cache.xml ]
then
echo "<result>true</result>"
else
echo "<result>false</result>"
fi

Forum|alt.badge.img+16
  • Author
  • Contributor
  • November 9, 2012

Thank you Steve. That is exactly what I needed!