Skip to main content
Question

Extension attribute for Chrome only works in terminal

  • June 13, 2019
  • 2 replies
  • 23 views

beeboo
Forum|alt.badge.img+7

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

donmontalvo
Forum|alt.badge.img+36
  • Hall of Fame
  • June 14, 2019

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

beeboo
Forum|alt.badge.img+7
  • Author
  • Contributor
  • June 18, 2019

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