Package libnss-mymachines: Scripts

Post install

if [ -f /etc/nsswitch.conf ] ; then
        sed -i.rpmorig -e '
                /^hosts:/ !b
                /\<mymachines\>/ b
                s/[[:blank:]]*$/ mymachines/
                ' /etc/nsswitch.conf >/dev/null 2>&1 || :

        sed -i.rpmorig -e '
                /^passwd:/ !b
                /\<mymachines\>/ b
                s/[[:blank:]]*$/ mymachines/
                ' /etc/nsswitch.conf >/dev/null 2>&1 || :

        sed -i.rpmorig -e '
                /^group:/ !b
                /\<mymachines\>/ b
                s/[[:blank:]]*$/ mymachines/
                ' /etc/nsswitch.conf >/dev/null 2>&1 || :
fi
update_chrooted all
Post uninstall

if [ "$1" = "0" ]; then
        if [ -f /etc/nsswitch.conf ] ; then
                sed -i.rpmorig -e '
                        /^hosts:/ !b
                        s/[[:blank:]]\+mymachines\>//
                        ' /etc/nsswitch.conf >/dev/null 2>&1 || :

                sed -i.rpmorig -e '
                        /^passwd:/ !b
                        s/[[:blank:]]\+mymachines\>//
                        ' /etc/nsswitch.conf >/dev/null 2>&1 || :

                sed -i.rpmorig -e '
                        /^group:/ !b
                        s/[[:blank:]]\+mymachines\>//
                        ' /etc/nsswitch.conf >/dev/null 2>&1 || :
        fi
fi
update_chrooted all