Try this (run it locally on test systems first, of course):
#!/bin/bash
currentUser=`ls -l /dev/console | awk '{print $3}'`
if [ -f "/Users/$currentUser/Library/ApplicationSupport/Google/Chrome/Default/Extensions/gkojfkhlekighikafcpjkiklfbnlmeio/1.2.449_0/js/cs_hola.js" ]; then
echo "<result>Yes</result>"
else
echo "<result>No</result>"
fi
Success! or Qapla! for our Klingon speaking JAMF members,
I made a mistake in the file path I published above. I used a indicating a space between "Application" and "Support". The entire path is in quotes. As soon as I got rid of the things worked nicely. Thanks for the help. "If file Exist" detection will be very useful for other future needs we will likely have. I'm sure we will be recycling this script.
Thanks again or "Qatlho" (like a Klingon would say thank you...)
Sincerely,
Paul
Rather than search for a single file whose path will change every time an update to the Hola extension is updated, you can search for the folder that contains this. This path will not change.
#!/bin/bash
currentUser=`ls -l /dev/console | awk '{print $3}'`
if [ -d "/Users/$currentUser/Library/Application Support/Google/Chrome/Default/Extensions/gkojfkhlekighikafcpjkiklfbnlmeio" ]; then
echo "<result>Yes</result>"
else
echo "<result>No</result>"
fi
I was able to cobble together a script for Firefox as well. Because, upon first launch, Firefox creates a profile folder with a randomly-generated name, it's hard to code for a specific path like you can with Google Chrome. But you can have your script search for a folder that's part of the Hola installation in the "Profiles" folder and then output a value based on the results:
#!/bin/bash
currentUser=`ls -l /dev/console | awk '{print $3}'`
holaFirefox=`find /Users/${currentUser}/Library/Application Support/Firefox/Profiles -iname "hola_firefox_ext" -type d`
if [ -z "${holaFirefox}" ]; then
echo "<result>No</result>"
else
echo "<result>Yes</result>"
fi
And now I can create a smart group to see who has Hola installed for Chrome and Firefox. And then I can easily create a policy that runs a script to delete the Hola VPN/proxy.
Yes, an end-user could re-install it, but the next time their machine Reconned, they'd be put back into the smart group and have the policy executed to delete it again. Not perfect, but pretty good.
I may play around with deleting a specific important file that's part of the Hola installation. This would make it look the end-user like Hola is installed but would break its functionality. Adds another layer of obfuscation they'd have to troubleshoot through to get it running.
Did you ever do anymore work on this? I am think of adding this to my implementation of SavingThrow