#!/bin/sh
set -e
# Automatically added by dh_installnss/1.7
if [ "$1" = "configure" ] && [ -f "${DPKG_ROOT}/etc/nsswitch.conf.nss.${DPKG_MAINTSCRIPT_PACKAGE}-will-install" ] && [ -e "${DPKG_ROOT}/etc/nsswitch.conf" ] ; then
	if ! grep -q -E  -e '^hosts:[^#]*\s(myhostname)(\s|#|$)' "${DPKG_ROOT}/etc/nsswitch.conf" ; then
		# Installing hosts/myhostname from libnss-myhostname in position last
		sed -E -i "${DPKG_ROOT}/etc/nsswitch.conf" -e '/^hosts:\s[^#]*$/ s/$/ myhostname/' -e '/^hosts:\s.*#/ s/#/ myhostname #/'
	fi
	rm "${DPKG_ROOT}/etc/nsswitch.conf.nss.${DPKG_MAINTSCRIPT_PACKAGE}-will-install"
fi
# End automatically added section
