Extension Attribute Help

Kevin
Contributor II

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?

1 ACCEPTED SOLUTION

stevewood
Honored Contributor II
Honored Contributor II

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

View solution in original post

2 REPLIES 2

stevewood
Honored Contributor II
Honored Contributor II

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

Kevin
Contributor II

Thank you Steve. That is exactly what I needed!