Sophie

Sophie

distrib > Mandriva > 9.0 > x86_64 > media > main > by-pkgid > 8e005934caf7f91be5352fd380e5f1a5 > scriptlet

nss_wins-2.2.7a-10mdk.x86_64.rpm

PREUN

/bin/sh
if [ $1 = 0 ]; then
	echo "Removing wins entry from /etc/nsswitch.conf"
	perl -pi -e 's/ wins//' /etc/nsswitch.conf
#else
#	echo "Leaving /etc/nsswitch.conf intact"
fi

POSTIN

/bin/sh
if [ $1 = 1 ]; then
    cp -af /etc/nsswitch.conf /etc/nsswitch.conf.rpmsave
    grep '^hosts' /etc/nsswitch.conf |grep -v 'wins' >/dev/null
    if [ $? = 0 ];then
        echo "Adding a wins entry to the hosts section of /etc/nsswitch.conf"
        awk '/^hosts/ {print $0 " wins"};!/^hosts/ {print}' /etc/nsswitch.conf.rpmsave >/etc/nsswitch.conf;
    else
        echo "wins entry found in /etc/nsswitch.conf"
    fi
#    else
#        echo "Upgrade, leaving nsswitch.conf intact"
fi