Posted on 06-12-2017 09:49 AM
Hello All, I am hoping you can help me with an extension attribute that isn't quite working,
This summer, we are switching from Lightspeed to Securly. I want to create an extension attribute that looks for the Lightspeed Mobile Filter plist.
I am using this code for the attribute:
file="/Library/LaunchDaemons/com.lightspeedsystems.mobilefilter.plist"
if [[ -e $file ]]; then
echo "yes"
elif [[ ! -e $file ]]; then
echo "no"
fi
When I run it through ARD, I get a "yes" from computer that has the Lightspeed Mobile Filter installed. I created the extension attribute in our JSS, but none of the computers are reporting back.
I used Data Type: String, Inv Display: General, Input Type: Script
Posted on 06-12-2017 09:54 AM
@jgrubbs You need to wrap your echoes with <result></result>
tags for EA responses.
Posted on 06-12-2017 09:56 AM
@StoneMagnet like this:
if [[ -e $file ]]; then
<result>echo "yes"</result>
elif [[ ! -e $file ]]; then
<result>echo "no"</result>
fi
Posted on 06-12-2017 10:03 AM
@jgrubbs Almost, you need put those tags inside your echo like echo "<result>Some response here</result>"
. What you return inside those tags is what the JSS displays for the EA response.
Posted on 06-12-2017 02:23 PM
Not sure elif
or double brackets is needed, how about?
#!/bin/bash
file="/Library/LaunchDaemons/com.lightspeedsystems.mobilefilter.plist"
if [ -e $file ]; then
echo "<result>yes</result>"
else
echo "<result>no</result>"
fi