Populating an Extension Attribute Not Working

joethedsa
Contributor II

A few weeks back Apple released a supplemental update (2020--005) for macOS Mojave then quickly pulled it because it was causing issues. They then fixed it and released it again. Regardless if a computer had the faulty or the fixed update, the system build will be "18G6032". I'm trying to populate an EA using Data Type = String and Input Type = Script. I will then create a SmartGroup that I'll be able to identify computers that need the new Supplement update AND that are on the 18G6032 build. Here is the script I'm using for the EA:

#!/bin/bash

if /usr/sbin/softwareupdate -l | grep -q 'Supplemental'; then
    echo "Present"
else
    echo "Not Present"
fi

If I understand this correctly, I'm using the "softwareupdate -l" command to list the available updates and if the word "Supplemental" is found/not found it is supposed to populate the EA with Present or Not Present. When I run this from ARD to a remote computer it is working fine however when I put it in an EA, the field is blank. I've done a recon on my test computer as well. Anyone have any thoughts as to what I'm missing.

1 ACCEPTED SOLUTION

Tribruin
Valued Contributor II

You need to put your responses in <result></result> tags.

For example echo "<result>Present</result>"

View solution in original post

2 REPLIES 2

Tribruin
Valued Contributor II

You need to put your responses in <result></result> tags.

For example echo "<result>Present</result>"

joethedsa
Contributor II

@RBlount , that did the trick. Thanks!