Help with Extension Attribute

jgrubbs
New Contributor III

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:

!/usr/bin/env bash

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: Script9fbeb10a40d54e3ab1696f5198070b01
b9304f9380b843ea91ddbcb11a6e3d56
9091b173c9334139ac6364132ab4bbab

4 REPLIES 4

StoneMagnet
Contributor III

@jgrubbs You need to wrap your echoes with <result></result> tags for EA responses.

jgrubbs
New Contributor III

@StoneMagnet like this:

if [[ -e $file ]]; then <result>echo "yes"</result>
elif [[ ! -e $file ]]; then <result>echo "no"</result>
fi

StoneMagnet
Contributor III

@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.

donmontalvo
Esteemed Contributor III

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
--
https://donmontalvo.com