EA for Google Chrome extensions

macmanmk
Contributor

I've configured the script below to check if users have a specific Chrome extension installed. I thought is was working okay, but I found out if a user has signed into his or her Google account in Chrome, the extensions are kept in a separate directory. Is there some way to modify the script so both locations are checked? For users that are signed into their Google account, the file path is...

"$currentUser"/Library/Application Support/Google/Chrome/Profile 1/Extensions/kehlnacjpfpmnkmhdladdicpbfpecfmh"

The "Profile 1" directory will not exist for users that haven't signed into a Google account and that constitutes a majority of our users.

#Identifies install status of DS Search Chrome extension
#!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/kehlnacjpfpmnkmhdladdicpbfpecfmh" ]]; 
then
     echo "<result>Installed</result>"
else
     echo "<result>NOT Installed</result>"
fi
1 ACCEPTED SOLUTION

macmanmk
Contributor

Guess I just needed the operator for OR

#Identifies install status of DS Search Chrome extension
#!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/kehlnacjpfpmnkmhdladdicpbfpecfmh" ]] || [[ -e "/Users/"$currentUser"/Library/Application Support/Google/Chrome/Profile 1/Extensions/kehlnacjpfpmnkmhdladdicpbfpecfmh" ]]
then
     echo "<result>Installed</result>"
else
     echo "<result>NOT Installed</result>"
fi

View solution in original post

1 REPLY 1

macmanmk
Contributor

Guess I just needed the operator for OR

#Identifies install status of DS Search Chrome extension
#!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/kehlnacjpfpmnkmhdladdicpbfpecfmh" ]] || [[ -e "/Users/"$currentUser"/Library/Application Support/Google/Chrome/Profile 1/Extensions/kehlnacjpfpmnkmhdladdicpbfpecfmh" ]]
then
     echo "<result>Installed</result>"
else
     echo "<result>NOT Installed</result>"
fi