#!/bin/bash 

if [ -e "${INSTALLER_TEMP}/com.apple.ODSAgent.enabled" ] ; then
	var=`defaults read "$3/System/Library/LaunchDaemons/com.apple.ODSAgent" Disabled 2>/dev/null`
	if [ "$var" == "1" ] ; then
		"$1/Contents/Resources/PlistBuddy" -c "Delete Disabled" "$3/System/Library/LaunchDaemons/com.apple.ODSAgent.plist"
		if [ "$3" == "/" ] ; then
			/sbin/service com.apple.ODSAgent start
		fi
	fi
fi
