1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-11-22 00:35:15 +00:00
freebsd-ports/irc/ratbox-services/files/pkg-install.in
Chris Rees f110d8fa00 ratbox-services now uses USERS and GROUPS
PR:		ports/157590
Approved by:	rene (mentor, implicit), Moggie <moggie@elasticmind.net> (maintainer)
2011-07-05 16:40:02 +00:00

47 lines
1.2 KiB
Bash

#!/bin/sh
#
# Adapted from irc/ircd-hybrid's script
#
#-----------------------------------------------------------------------
if [ "x$2" = "xPRE-INSTALL" ]; then
#-----------------------------------------------------------------------
# ${DO_NADA}
#-----------------------------------------------------------------------
elif [ "x$2" = "xPOST-INSTALL" ]; then
#-----------------------------------------------------------------------
lf="%%LOGDIR%%/ratbox-services.log"
touch $lf \
&& chown ircservices:ircservices $lf \
&& chmod 640 $lf
mkdir -p %%DBDIR%% \
&& chown ircservices:ircservices %%DBDIR%% \
&& chmod 750 %%DBDIR%%
# Secure permissions if we think this is a fresh install
conffile="%%PREFIX%%/etc/ratbox-services.conf"
samplefile="%%PREFIX%%/etc/ratbox-services.conf.sample"
if cmp -s $conffile $samplefile; then
echo "Setting permissions for config file."
chown ircservices:ircservices $conffile
chmod 640 $conffile
else
echo "Modified ratbox-services.conf file found, skipping perms setting."
fi
cd %%DATADIR%% \
&& %%PERL%% ./generate-schema.pl
#-----------------------------------------------------------------------
fi
#-----------------------------------------------------------------------
exit 0