I tried to adapt the script from https://jamfnation.jamfsoftware.com/discussion.html?id=6630 and I got it 1/2 working... but it always returns back that the file is not there, even though I can ssh into the test box and see that it is... Could someone point out where the logic is wrong?
#!/bin/bash
#
# looks for the FVMaster keychain.
files=('FileVaultMaster.keychain')
subdirs=('/Library/Keychains')
FVMaster" "
for d in ${subdirs[@]}; do
for f in ${files[@]]}; do
if [ ! -z `find $d -maxdepth 1 -name $f` ]; then
FVMaster=1
fi
done
done
if [ $FVMaster]; then
echo "<result>FileVaultMaster detected</result>"
else
echo "<result>FileVaultMaster Not found</result>"
fi