Hi Everyone,
I'm working on an EA to check for the presence of a particular cert in the user's Login keychain.:
1#!/bin/bash2currentUser=`stat -f '%Su' /dev/console`3echo "Current username is $currentUser"45fullName=$(dscl . read /Users/`whoami` RealName | grep -v RealName | cut -c 2-)6echo "Full Name is: $fullName"78firstName=$(echo $fullName | awk '{print $1;}')9echo "First Name is: $firstName"1011CERTNAME=$firstName12echo "Cert Name is $CERTNAME"1314if [[ `security find-certificate -c $CERTNAME /Users/$currentUser/Library/Keychains/login.keychain` ]]; then15 echo "<result>Installed</result>"16else17 echo "<result>Not Installed</result>"18fi19exit 0
Basically, the certificate we're looking for always has the user's first name. The script returns the proper result (Installed) when I run the script locally on my Mac, but always returns "Not Installed" when deployed as an EA. Has anyone else ran in to this behavior before? At first I thought it was the "currentUser" variable not setting correctly, but even when I plug in a defined user folder in the if statement , the EA returns "Not Installed"
-Mike