aboutsummaryrefslogtreecommitdiffstats
path: root/dns/bind99/pkg-install
blob: 12b2f98aaf25ed1c5337a42ebfcb6e9637e74b8c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/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