PREUN
/bin/sh
# sed-fu to remove myhostname from the hosts line of /etc/nsswitch.conf if [ "$1" -eq 0 -a -f /etc/nsswitch.conf ] ; then sed -i.bak -e ' /^hosts:/ !b s/[[:blank:]]\+myhostname\>// ' /etc/nsswitch.conf fi
POSTIN
/bin/sh
/sbin/ldconfig # sed-fu to add myhostname to the hosts line of /etc/nsswitch.conf if [ -f /etc/nsswitch.conf ] ; then sed -i.bak -e ' /^hosts:/ !b /\<myhostname\>/ b s/[[:blank:]]*$/ myhostname/ ' /etc/nsswitch.conf fi