1 2 3 4 5 6 7 8 9
if [ -f /etc/nsswitch.conf ] ; then grep -E -q '^hosts:.* myhostname' /etc/nsswitch.conf || sed -i.rpmorig -e ' /^hosts:/ !b /\<myhostname\>/ b s/[[:blank:]]*$/ myhostname/ ' /etc/nsswitch.conf >/dev/null 2>&1 || : fi update_chrooted all
if [ "$1" = "0" ]; then if [ -f /etc/nsswitch.conf ] ; then sed -i.rpmorig -e ' /^hosts:/ !b s/[[:blank:]]\+myhostname\>// ' /etc/nsswitch.conf >/dev/null 2>&1 || : fi fi update_chrooted all