Sophie

Sophie

distrib > Fedora > 14 > i386 > media > os > by-pkgid > 8dd34f290318bb3325f9e75a1b97db45 > scriptlet

nss-myhostname-0.2-3.fc12.i686.rpm

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