#!/bin/bash 

# 4665091

cd "$3/System/Library/LaunchDaemons"
ls | sed 's,\.plist$,,g' | while read
do
	if [ -e "${INSTALLER_TEMP}/${REPLY}.enabled" ] ; then
		var=`defaults read "$3/System/Library/LaunchDaemons/${REPLY}" Disabled 2>/dev/null`
		if [ "$var" == "1" ] ; then
			"$1/Contents/Resources/PlistBuddy" -c "Delete Disabled" "$3/System/Library/LaunchDaemons/${REPLY}.plist"
		fi
	fi
done
