Sophie

Sophie

distrib > Mandriva > 10.0 > i586 > media > main > by-pkgid > 60fea577b2eeeefbdfbfabe43844b7fe > scriptlet

nss_wins-3.0.2a-3mdk.i586.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