I've attached a snapshot of a "script exit code 2" from my logs. Just weeding out the bugs with this one, but I'm not certain that this particular script works best. Possible suggestions?

<?xml version="1.0" encoding="UTF-8"?>
<extensionAttribute>
<displayName>OS - Disable Automatic Login</displayName>
<displayInCategory>Security Reporting</displayInCategory>
<dataType>string</dataType>
<description>This attribute verifies that automatic login is disabled. The value to be verified will need to be specified when creating this extension attribute. Example: "true" verifies that automatic login is disabled. This extension attribute requires this preference be set using Managed Preferences (MCX).</description>
<scriptContentsMac>#!/bin/sh
desiredValue="EditFromTemplate_Desired_Value_-_Example:_true"
appDomain="com.apple.loginwindow"
keyName="com.apple.login.mcx.DisableAutoLoginClient"
result=""
tmpResult="dscl . mcxread /Computers/localhost "$appDomain" "$keyName" |grep Value:| sed 's/Value: //g'"
if [ "$tmpResult" == "1" ]; then
result="true"
else
if [ "$tmpResult" == "0" ]; then
result="false"
else
if [ "$tmpResult" == "" ]; then
result="Domain or Key Not Found"
else
result="$tmpResult"
fi
fi
fi
if [ "$result" == "$desiredValue" ]; then
echo "<result>Pass ($result)</result>"
else
echo "<result>Fail ($result)</result>"
fi
</scriptContentsMac>
</extensionAttribute>
