Posted on 03-27-2015 11:05 AM
I while back I put a post about showing off you Self Service. link This was great in the sense of giving the community ideas on how to use self service. After reading Shea Craig's article How We Are Removing Adware Am wondering how are you extending JAMF with extension attributes.
Come on all time show off you hard work.
Posted on 03-27-2015 11:15 AM
I've got a number of mine posted here:
Posted on 03-27-2015 12:44 PM
Some more of GitHub
https://github.com/smashism/casper-extension-attributes
https://github.com/quedayone/ExtensionAttributes
https://github.com/74bit/Casper-Extension-Attributes
https://github.com/mm2270/UpdateExtensionAttributes
https://github.com/franton/Extension-Attributes
https://github.com/andrina/Casper-Stuff/tree/master/Machine%20CPU%20Usage
Posted on 08-25-2015 05:26 PM
Is there somewhere that states that an extension attribute can only output 1 if statement?
I have tested 1 EA with 3 (for now) if statements, but it only outputs the first one.
Trying to consolidate instead of having 30+ EAs for security compliance.
for example:
EA name = Security
#!/bin/sh
a=1
if [ $a != 1 ]
then
echo "<result>step 1 wrong</result>"
else
:
fi
b=2
if [ $b != 2 ]
then
echo "<result>step 2 wrong</result>"
else
:
fi
c=3
if [ $c != 3 ]
then
echo "<result>step 3 wrong</result>"
else
:
fi
for a machine A where a=0, b=0, c=0, i would like the output to be:
Security: step 1 wrong step 2 wrong step 3 wrong
or Security: step 1 wrong step 2 wrong step 3 wrong
for machine B where a=1, b=2, c=3, i would like the output to be:
Security:
Thanks for looking. I will post my EAs once I clean them for sensitive data.
Posted on 08-26-2015 05:25 AM
@jserapio No, since all you care about is what is between the results tags, you can make that anything you want to be. You just need to build the string of text that you want to be there (you have to get it all in one return tag since the JSS will only read in the first result tag returned). Normally in something like python I would build an array and then iterate through it to do that, but just to use your own simple example here, this is how I would modify it to do what you want:
#!/bin/sh
a=1
if [ $a != 1 ]
then
a_result="wrong"
else
a_result="right"
fi
b=2
if [ $b != 2 ]
then
b_result="wrong"
else
b_result="right"
fi
c=3
if [ $c != 3 ]
then
c_result="wrong"
else
c_result="right"
fi
echo "<result>Step 1: $a_result, Step 2: $b_result, Step 3: $c_result</result>"
Posted on 08-26-2015 05:30 AM
I've got a ton in my work's git repository that I need to sanitize as well, but here are some I recently started putting up: https://github.com/christophercollins/
Posted on 08-26-2015 10:20 AM
Thanks @chriscollins , I will give this a shot.
Posted on 08-26-2015 10:29 AM
Here's one for finding the version of BlackMagic drivers. Their v10 drivers updated their prefpanes and the version info in them is incorrect. This checks if the v9 drivers are there, and if not looks elsewhere for the version info.
#!/bin/bash
if [ -e /Library/PreferencePanes/DesktopVideoPrefsPanel.prefPane ]; then
version=`defaults read /Library/PreferencePanes/DesktopVideoPrefsPanel.prefPane/Contents/Info.plist CFBundleVersion`
if [[ $version =~ "^[0-9]+$" ]]; then
bar=N/A
else
bar=$version
fi
elif [ -e /Applications/Blackmagic Desktop Video/Blackmagic Multibridge Utility.app ]; then
version=`defaults read /Applications/Blackmagic Desktop Video/Blackmagic Multibridge Utility.app/Contents/Info.plist CFBundleVersion`
if [[ $version =~ "^[0-9]+$" ]]; then
bar=N/A
else
bar=$version
fi
else
bar=N/A
fi
echo "<result>$bar</result>"
Posted on 08-26-2015 10:31 AM
And check the Matrox driver version.
#!/bin/bash
if [ -e /Library/PreferencePanes/com.matrox.vpg.MXO2.prefPane ]; then
version=`defaults read /Library/PreferencePanes/com.matrox.vpg.MXO2.prefPane/Contents/Info.plist CFBundleShortVersionString`
bar=$version
else
bar=N/A
fi
echo "<result>$bar</result>"