1999-09-23 07:32:45 -04:00
|
|
|
#!/bin/sh
|
|
|
|
#
|
1999-12-17 12:56:30 -05:00
|
|
|
# $OpenBSD: INSTALL,v 1.3 1999/12/17 17:56:30 ho Exp $
|
1999-09-23 07:32:45 -04:00
|
|
|
#
|
|
|
|
# Pre/post-installation setup of named
|
|
|
|
|
|
|
|
set -e
|
|
|
|
PATH=/bin:/usr/bin:/sbin:/usr/sbin
|
|
|
|
PREFIX=${PKG_PREFIX:-/}
|
1999-12-17 12:56:30 -05:00
|
|
|
NROOT=${DESTDIR}/var/named
|
1999-09-23 07:32:45 -04:00
|
|
|
|
1999-10-29 08:54:22 -04:00
|
|
|
SAMPLEDIR=${3:-/usr/local/share/examples/bind8}
|
|
|
|
|
|
|
|
print_usage()
|
|
|
|
{
|
|
|
|
echo "usage: $0 distname { PRE-INSTALL | POST-INSTALL}" >&2
|
|
|
|
}
|
1999-09-23 07:32:45 -04:00
|
|
|
|
|
|
|
pre_fix_dir()
|
|
|
|
{
|
|
|
|
if [ ! -d ${1} ]; then
|
|
|
|
rm -f ${1}
|
|
|
|
mkdir -p ${1}
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ "x${2}" != "x" ]; then
|
|
|
|
chown ${2} ${1}
|
|
|
|
chmod ${3} ${1}
|
|
|
|
else # default
|
|
|
|
chown root:wheel ${1}
|
|
|
|
chmod 0755 ${1}
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
1999-10-29 08:54:22 -04:00
|
|
|
if [ $# -ne 2 -a $# -ne 3 ]; then
|
|
|
|
print_usage
|
|
|
|
exit 1
|
|
|
|
fi
|
1999-09-23 07:32:45 -04:00
|
|
|
|
|
|
|
# Verify/process the command
|
|
|
|
#
|
|
|
|
case $2 in
|
|
|
|
PRE-INSTALL)
|
|
|
|
# Note "descending" order
|
1999-12-17 12:56:30 -05:00
|
|
|
pre_fix_dir ${DESTDIR}/usr/share/doc/html/named
|
|
|
|
pre_fix_dir ${DESTDIR}/usr/libexec/named
|
1999-09-23 07:32:45 -04:00
|
|
|
pre_fix_dir ${NROOT}
|
|
|
|
pre_fix_dir ${NROOT}/slave named:bin 0755
|
|
|
|
pre_fix_dir ${NROOT}/master named:bin 0755
|
|
|
|
pre_fix_dir ${NROOT}/var
|
|
|
|
pre_fix_dir ${NROOT}/var/run named:bin 0755
|
|
|
|
pre_fix_dir ${NROOT}/var/tmp root:wheel 01777
|
|
|
|
pre_fix_dir ${SAMPLEDIR}
|
|
|
|
;;
|
|
|
|
POST-INSTALL)
|
|
|
|
echo "" >&2
|
|
|
|
echo "Check your /etc/rc.conf file for the 'named' options." >&2
|
|
|
|
echo "Recommended (and also OpenBSD default) values are:" >&2
|
|
|
|
echo " named_flags=\"\"" >&2
|
|
|
|
echo " named_user=named" >&2
|
|
|
|
echo " named_chroot=${NROOT}" >&2
|
|
|
|
echo "" >&2
|
1999-10-29 08:54:22 -04:00
|
|
|
|
|
|
|
if [ ! -d ${SAMPLEDIR} ]; then
|
|
|
|
# Oops.
|
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
echo "Sample configuration files have been installed to directory" >&2
|
|
|
|
echo " ${SAMPLEDIR}" >&2
|
|
|
|
echo "" >&2
|
|
|
|
echo "Proper modes for the sample files are [{owner,group,mode}]" >&2
|
|
|
|
echo " {root,named,640} for named.conf" >&2
|
|
|
|
echo " {root,wheel,644} for the rest" >&2
|
|
|
|
echo "" >&2
|
|
|
|
echo "Check/modify named.conf to suit your site." >&2
|
1999-09-23 07:32:45 -04:00
|
|
|
echo "" >&2
|
|
|
|
;;
|
|
|
|
*)
|
1999-10-29 08:54:22 -04:00
|
|
|
print_usage
|
1999-09-23 07:32:45 -04:00
|
|
|
exit 1
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
exit 0
|