Extension attribute for Chrome only works in terminal

beeboo
Contributor

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

2 REPLIES 2

donmontalvo
Esteemed Contributor II

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 + "
");' )

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

beeboo
Contributor

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