#!/bin/sh PREF=${PREFIX:-$PKG_PREFIX} PATH=/bin:/usr/sbin:/usr/bin case $2 in POST-INSTALL) GROUP=users if pw group show "${GROUP}" 2>/dev/null; then echo "You already have a group \"${GROUP}\", so I will use it." else if pw groupadd ${GROUP}; then echo "Added group \"${GROUP}\"." else echo "Adding group \"${GROUP}\" failed..." exit 1 fi fi ${TOUCH} /etc/mail/access; mkdir -p ${PREF}/raqdevil/ui/web/base/sitestats/img; chown www:wheel ${PREF}/raqdevil/ui/web/base/sitestats/img; mkdir -p ${PREF}/raqdevil/sessions; ${TOUCH} ${PREF}/etc/apache2/httpd.local.conf ${TOUCH} ${PREF}/etc/apache2/httpd.raqdevil.conf # generate certificates if required CERTPATH=${PREF}/admserv/certs KEYPATH=${CERTPATH}/key CSRPATH=${CERTPATH}/request CRTPATH=${CERTPATH}/certificate mkdir -p ${CERTPATH} if [ ! -f ${KEYPATH} ]; then openssl genrsa -out ${KEYPATH} 2048 fi if [ ! -f ${CSRPATH} ]; then openssl req -new -key ${KEYPATH} -out ${CSRPATH} fi if [ ! -f ${CRTPATH} ]; then openssl x509 -req -days 365 -in ${CSRPATH} -signkey ${KEYPATH} -out ${CRTPATH} fi # fix up the apache httpd.conf file using database values # probably should use /usr/local/raqdevil/bin/cce_construct instead # to make a package install work correctly ${PREF}/raqdevil/constructor/base/apache/processAdvise.pl ( cd /etc/namedb; sh /etc/namedb/make-localhost ) ;; esac