Not getting any resultes in Extension Attributes

rob_potvin
Contributor III
Contributor III

EDIT: Extension Attributes are working (sorry can't edit title) just the following script is not giving me a result.

Running this script via jss

#!/bin/sh
userList=$(/usr/bin/dscl . list /Users UniqueID | /usr/bin/awk '$2 > 500 { print $1 }')
# now loop through results and test for membership of the admin group
for u in ${userList} ; do
    if [[ `/usr/bin/dscl . read /Groups/admin GroupMembership | /usr/bin/grep -c ${u}` == 1 ]]
        then /bin/echo "<results>${u}</results>"
        #else /bin/echo "${u} is not an admin.."
    fi
done

but I am not getting the result that I want... Nothing is showing up...

Looks like this

Comic Life Version: 1.5.5 (v19107)
File Sharing: Off
Firefox Version: 9.0.1
Flash Version: 11.1.102.55
Last User: rob
List of Admins:

As you can see List of Admins: is blank..

I take that same script and run it in terminal and I get the following result.

<results>rob</results>

Can anyone else try this and see if they can get a result?

Thanks

1 ACCEPTED SOLUTION

rob_potvin
Contributor III
Contributor III

Okay people I am not on crack, honest! I figured out my problem

then /bin/echo "<results>${u}</results>"

Should be:

then /bin/echo "<result>${u}</result>"

View solution in original post

5 REPLIES 5

rob_potvin
Contributor III
Contributor III

Okay people I am not on crack, honest! I figured out my problem

then /bin/echo "<results>${u}</results>"

Should be:

then /bin/echo "<result>${u}</result>"

tlarkin
Honored Contributor

I am the original author of that script and I think I fixed that in a different version back on the days of the mailing list.

Glad you got it fixed.

rob_potvin
Contributor III
Contributor III

And for that I did offer free beer to you anytime you come to Munich Germany :-)

tlarkin
Honored Contributor
And for that I did offer free beer to you anytime you come to Munich Germany :-)

that sounds great, too bad you cannot email people beers! :-)

lance_ogletree
Contributor

Sure you can

0100110101101001011011000110110001100101011100100010000001001100011010010111010001100101

Happy Friday.