Sophie

Sophie

distrib > Mandriva > 9.0 > x86_64 > media > main > by-pkgid > be6ff34d1b55a6fa0aedae6d04b1d0a8 > scriptlet

samba-winbind-2.2.7a-10mdk.x86_64.rpm

PREUN

/bin/sh
/usr/share/rpm-helper/del-service samba $1 winbind 
if [ $1 = 0 ]; then
	echo "Removing winbind entries from /etc/nsswitch.conf"
	perl -pi -e 's/ winbind//' /etc/nsswitch.conf

#	/sbin/chkconfig winbind reset
fi

POSTIN

/bin/sh
/usr/share/rpm-helper/add-service samba $1 winbind 
if [ $1 = 1 ]; then
#    /sbin/chkconfig winbind 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 'winbind' 1>/dev/null 2>/dev/null
        if [ $? = 0 ];then
            echo "Adding a winbind entry to the $i section of /etc/nsswitch.conf"
            awk '/^'$i'/ {print $0 " winbind"};!/^'$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