I am getting this error for the script below – any ideas?:
attribute status: eDSAttributeValueNotFound
DS Error: -14143 (eDSAttributeValueNotFound)
attribute status: eDSAttributeValueNotFound
DS Error: -14143 (eDSAttributeValueNotFound)
/private/tmp/LionADsearchPathFix3.sh: line 15: syntax error near unexpected token `else'
/private/tmp/LionADsearchPathFix3.sh: line 15: `else '
#!/bin/bash
dsconfigad -alldomains disable
csp="dscl /Search -read / CSPSearchPath | grep /Active"
if dscl /Search -read / CSPSearchPath | grep /Active > /dev/null
then
/usr/bin/dscl /Search -change / CSPSearchPath "$csp" "/Active Directory/tree/domain.com"
/usr/bin/dscl /Search/Contacts -change / CSPSearchPath "$csp" "/Active Directory/tree/domain.com"
fi
else
dscl /Search -append / CSPSearchPath "/Active Directory/tree/domain.com"
dscl /Search -create / SearchPolicy dsAttrTypeStandard:CSPSearchPath
dscl /Search/Contacts -append / CSPSearchPath "/Active Directory/tree/domain.com"
dscl /Search/Contacts -create / SearchPolicy dsAttrTypeStandard:CSPSearchPath
exit 0