Hi Everyone,
I'm working on an EA to check for the presence of a particular cert in the user's Login keychain.:
#!/bin/bash
currentUser=`stat -f '%Su' /dev/console`
echo "Current username is $currentUser"
fullName=$(dscl . read /Users/`whoami` RealName | grep -v RealName | cut -c 2-)
echo "Full Name is: $fullName"
firstName=$(echo $fullName | awk '{print $1;}')
echo "First Name is: $firstName"
CERTNAME=$firstName
echo "Cert Name is $CERTNAME"
if [[ `security find-certificate -c $CERTNAME /Users/$currentUser/Library/Keychains/login.keychain` ]]; then
echo "<result>Installed</result>"
else
echo "<result>Not Installed</result>"
fi
exit 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