aboutsummaryrefslogtreecommitdiffstats
path: root/dns/bind99/pkg-install
blob: df1fc8ad76396ff29b627963082c2243ce8e95f6 (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
#!/bin/sh

if [ "$2" = 'POST-INSTALL' ]
then
    /bin/mkdir -p /var/named${PKG_PREFIX}/etc
fi

for DIR in ${PKG_PREFIX}/etc /var/named${PKG_PREFIX}/etc; do
    for FILE in named.conf rndc.key; do
        if [ "$2" = 'POST-INSTALL' ]
        then
            /bin/ln -sf /etc/namedb/${FILE} ${DIR}/${FILE}
        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 > /dev/null  2>&1 || :
fi

exit 0