Sophie

Sophie

distrib > Mandriva > 9.1 > ppc > by-pkgid > 5220ee1051e8a6f9282be257ed775fc1 > scriptlet

samba3-winbind-3.0-0.alpha22.2mdk.ppc.rpm

PREUN

/bin/sh
if [ $1 = 0 ]; then
	echo "Removing winbind3 entries from /etc/nsswitch.conf"
	perl -pi -e 's/ winbind3//' /etc/nsswitch.conf

	/sbin/chkconfig winbind3 reset
fi

POSTIN

/bin/sh
if [ $1 = 1 ]; then
    /sbin/chkconfig winbind3 on
    cp -af /etc/nsswitch.conf /etc/nsswitch.conf.rpmsave
    cp -af /etc/nsswitch.conf /etc/nsswitch.conf.rpmtemp
    for i in passwd group;do
        grep ^$i /etc/nsswitch.conf |grep -v 'winbind3' >/dev/null
        if [ $? = 0 ];then
            echo "Adding a winbind3 entry to the $i section of /etc/nsswitch.conf"
            awk '/^'$i'/ {print $0 " winbind3"};!/^'$i'/ {print}' /etc/nsswitch.conf.rpmtemp >/etc/nsswitch.conf;
	    cp -af /etc/nsswitch.conf /etc/nsswitch.conf.rpmtemp
        else
            echo "$i entry found in /etc/nsswitch.conf"
        fi
    done
    if [ -f /etc/nsswitch.conf.rpmtemp ];then rm -f /etc/nsswitch.conf.rpmtemp;fi
fi