#!/bin/sh

if [ -f /tmp/wildfire.xml ]; then 
	mv /tmp/wildfire.xml /usr/local/wildfire/conf/
fi

if [ -f /tmp/security ]; then
	mv /tmp/security /usr/local/wildfire/resources/
fi

WILDFIRE_HOME=/usr/local/wildfire/
WILDFIRE_GID=`cat /private/tmp/wildfiregid`
rm /private/tmp/wildfiregid

chown -R wildfire $WILDFIRE_HOME
chgrp -R $WILDFIRE_GID $WILDFIRE_HOME

/bin/launchctl load /Library/LaunchDaemons/org.jivesoftware.wildfire.plist