93272c5ded
Requested by: many Sponsored by: Absolight
32 lines
683 B
Bash
32 lines
683 B
Bash
#!/bin/sh
|
|
# ex:sw=8 sts=8
|
|
|
|
if [ "$2" = 'POST-INSTALL' ]
|
|
then
|
|
/bin/mkdir -p /var/named${PKG_PREFIX}/etc/namedb
|
|
fi
|
|
|
|
for DIR in ${PKG_PREFIX}/etc/namedb /var/named${PKG_PREFIX}/etc/namedb; do
|
|
for FILE in named.conf rndc.conf rndc.key; do
|
|
if [ "$2" = 'POST-INSTALL' ]
|
|
then
|
|
if [ -e ${PKG_PREFIX}/etc/${FILE} ]
|
|
then
|
|
/bin/cp -a ${PKG_PREFIX}/etc/${FILE} ${DIR}/${FILE}
|
|
else
|
|
/bin/ln -sf /etc/namedb/${FILE} ${DIR}/${FILE}
|
|
fi
|
|
fi
|
|
if [ "$2" = 'POST-DEINSTALL' ]
|
|
then
|
|
[ -L ${DIR}/${FILE} ] && rm -f ${DIR}/${FILE}
|
|
fi
|
|
done
|
|
done
|
|
|
|
if [ "$2" = 'POST-DEINSTALL' ]
|
|
then
|
|
cd /var/named && /bin/rmdir -p ./${PKG_PREFIX}/etc/namedb > /dev/null 2>&1 || :
|
|
fi
|
|
|
|
exit 0
|