#!/bin/sh
# Jim McDonald - 2009-05-26
# apache - postinstall script
# This will add the application to the startup configuration
# By default, it will NOT start the application

APPLICATION="apache"
MANIFESTDIR=/var/svc/manifest/application/${APPLICATION}
SVCENTITY="svc:/application/webserver/apache:default"

#Just in case, verify that svccfg exists
if [ -x /usr/sbin/svccfg ]; then

	echo "Registering service with SMF"
	/usr/sbin/svccfg -v import ${MANIFESTDIR}/${APPLICATION}.xml

	echo "##################################################"
	echo "${SVCENTITY} has been registered"
	echo "with SMF. When you have finished configuring this application"
	echo "you can start it by running:"
	echo
	echo "/usr/sbin/svcadm enable ${SVCENTITY}"
	echo
	echo "##################################################"
else
	echo "Couldn't find configuration tool for SMF"
	echo "You will need to manually set up ${APPLICATION}"
	echo "to start on boot"
fi
