Skip to main content
Jamf Nation, hosted by Jamf, is a knowledgeable community of Apple-focused admins and Jamf users. Join us in person at the ninth annual Jamf Nation User Conference (JNUC) this November for three days of learning, laughter and IT love.

Extension attribute for Chrome only works in terminal

So the name of the chrome extension is is listed below and running this script in terminal brings forth no issues, but running the script in EA does.

i ran a recon - verbose and it throws and error into the TMP file

!bin/bash

Pulls the current logged in user

currentUser=$(stat -f%Su /dev/console)

if [[ -e "/Users/"$currentUser"/Library/Application Support/Google/Chrome/Default/Extensions/fckonodhlfjlkndmedanenhgdnbopbmh" ]];
then echo "<result>Installed</result>"
else echo "<result>NOT Installed</result>"
fi

Like Comment
Order by:
SOLVED Posted: by donmontalvo

Have you tried Italic? :)

#!/bin/bash
#Pulls the current logged in user

currentUser=$( python -c 'from SystemConfiguration import SCDynamicStoreCopyConsoleUser; import sys; username = (SCDynamicStoreCopyConsoleUser(None, None, None) or [None])[0]; username = [username,""][username in [u"loginwindow", None, u""]]; sys.stdout.write(username + "\n");' )

if [ -e "/Users/"$currentUser"/Library/Application Support/Google/Chrome/Default/Extensions/fckonodhlfjlkndmedanenhgdnbopbmh" ];
then
    echo "<result>Installed</result>"
else
    echo "<result>NOT Installed</result>"
fi
Like
SOLVED Posted: by jcheLC

so i tried a slightly modified version

currentUser=$(stat -f%Su /dev/console)

walkMeVersion=$(ls -d "/Users/"$currentUser"/Library/Application Support/Google/Chrome/Default/Extensions/fckonodhlfjlkndmedanenhgdnbopbmh/"* | cut -f11 -d '/')

echo "<result>"Testing: $walkMeVersion"</result>"

exit 0

that works in shell to pull up version but wont display in EA as im trying to make a smart group from the EA

Like