POSTIN
/bin/sh
/sbin/ldconfig
if [ $1 = 1 ]; then
# ipv4 by default, as explained on the webpage
source /etc/sysconfig/network
if [ "${NETWORKING_IPV6}" = "yes" ]; then
# for both ipv6 and ipv4
perl -pi -e '!/mdns/ && s/^(hosts:\s*)([^#]*)(#?.*)$/$1 mdns_minimal $2 mdns $3/' /etc/nsswitch.conf
else
perl -pi -e '!/mdns/ && s/^(hosts:\s*)([^#]*)(#?.*)$/$1 mdns4_minimal $2 mdns4 $3/' /etc/nsswitch.conf
fi
fi
POSTUN
/bin/sh
/sbin/ldconfig
if [ $1 = 0 ]; then
perl -pi -e 's/^(hosts:.*)\smdns_minimal\d?(\s.*)$/$1 $2/' /etc/nsswitch.conf
perl -pi -e 's/^(hosts:.*)\smdns\d?(\s.*)$/$1 $2/' /etc/nsswitch.conf
fi