Sophie

Sophie

distrib > Mageia > 2 > i586 > by-pkgid > 103961ca21f1748a687d602445178fcd > scriptlet

bind-9.9.1.P4-1.mga2.i586.rpm

PREIN

/bin/sh
/usr/share/rpm-helper/add-user bind $1 named /var/lib/named /bin/false 

DATE=`date +%Y%m%d%j%S`
for f in named.conf rndc.conf rndc.key; do
    # move away files to prepare for softlinks
    if [ -f /etc/$f -a ! -h /etc/$f ]; then mv -vf /etc/$f /etc/$f.$DATE; fi
    if [ -f /etc/$f -a ! -h /etc/$f ]; then mv -vf /etc/$f /etc/$f.$DATE; fi
    if [ -f /etc/$f -a ! -h /etc/$f ]; then mv -vf /etc/$f /etc/$f.$DATE; fi
done

PREUN

/bin/sh
/usr/share/rpm-helper/del-service bind $1 named

POSTIN

/bin/sh
if grep -q "_MY_KEY_" /var/lib/named/etc/rndc.conf /var/lib/named/etc/rndc.key; then
    MYKEY="`/usr/sbin/dns-keygen`"
    perl -pi -e "s|_MY_KEY_|$MYKEY|g" /var/lib/named/etc/rndc.conf /var/lib/named/etc/rndc.key
fi
# remove device file created with wrong minor number (#3028)
urandom=/var/lib/named/dev/urandom
if [ -f $urandom ] && [ $(ls -l $urandom | awk '{print $6}') -eq 8 ]; then
    rm -f $urandom
fi
/usr/share/rpm-helper/add-service bind $1 named

POSTUN

/bin/sh
/usr/share/rpm-helper/del-user bind $1 named