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