#!/bin/sh
set -e
# Automatically added by dh_installnss/1.7
: "${DPKG_MAINTSCRIPT_PACKAGE_INSTCOUNT:=$(dpkg-query -f '${db:Status-Abbrev}\n' -W "$DPKG_MAINTSCRIPT_PACKAGE" | grep -c '^i')}"
if { [ "$1" = "remove" ] || [ "$1" = "purge" ] ; } && [ -e "${DPKG_ROOT}/etc/nsswitch.conf" ] && [ "$DPKG_MAINTSCRIPT_PACKAGE_INSTCOUNT" -eq 0 ] ; then
	sed -E -i "${DPKG_ROOT}/etc/nsswitch.conf" \
		-e ':a /^shadow:\s.*#/ s/(^[^#]+)\s(systemd)\s+\[!?[A-Za-z]+=[A-Za-z]+\](\s|#)/\1\3/g ; t a' \
		-e ':b /^shadow:\s.*#/ s/(^[^#]+)\s(systemd)(\s|#)/\1\3/g ; t b' \
		-e ':c /^shadow:\s[^#]*$/ s/\s(systemd)\s+\[!?[A-Za-z]+=[A-Za-z]+\](\s|$)/\2/g ; t c' \
		-e ':d /^shadow:\s[^#]*$/ s/\s(systemd)(\s|$)/\2/g ; t d'
fi
# End automatically added section
# Automatically added by dh_installnss/1.7
: "${DPKG_MAINTSCRIPT_PACKAGE_INSTCOUNT:=$(dpkg-query -f '${db:Status-Abbrev}\n' -W "$DPKG_MAINTSCRIPT_PACKAGE" | grep -c '^i')}"
if { [ "$1" = "remove" ] || [ "$1" = "purge" ] ; } && [ -e "${DPKG_ROOT}/etc/nsswitch.conf" ] && [ "$DPKG_MAINTSCRIPT_PACKAGE_INSTCOUNT" -eq 0 ] ; then
	sed -E -i "${DPKG_ROOT}/etc/nsswitch.conf" \
		-e ':a /^passwd:\s.*#/ s/(^[^#]+)\s(systemd)\s+\[!?[A-Za-z]+=[A-Za-z]+\](\s|#)/\1\3/g ; t a' \
		-e ':b /^passwd:\s.*#/ s/(^[^#]+)\s(systemd)(\s|#)/\1\3/g ; t b' \
		-e ':c /^passwd:\s[^#]*$/ s/\s(systemd)\s+\[!?[A-Za-z]+=[A-Za-z]+\](\s|$)/\2/g ; t c' \
		-e ':d /^passwd:\s[^#]*$/ s/\s(systemd)(\s|$)/\2/g ; t d'
fi
# End automatically added section
# Automatically added by dh_installnss/1.7
: "${DPKG_MAINTSCRIPT_PACKAGE_INSTCOUNT:=$(dpkg-query -f '${db:Status-Abbrev}\n' -W "$DPKG_MAINTSCRIPT_PACKAGE" | grep -c '^i')}"
if { [ "$1" = "remove" ] || [ "$1" = "purge" ] ; } && [ -e "${DPKG_ROOT}/etc/nsswitch.conf" ] && [ "$DPKG_MAINTSCRIPT_PACKAGE_INSTCOUNT" -eq 0 ] ; then
	sed -E -i "${DPKG_ROOT}/etc/nsswitch.conf" \
		-e ':a /^gshadow:\s.*#/ s/(^[^#]+)\s(systemd)\s+\[!?[A-Za-z]+=[A-Za-z]+\](\s|#)/\1\3/g ; t a' \
		-e ':b /^gshadow:\s.*#/ s/(^[^#]+)\s(systemd)(\s|#)/\1\3/g ; t b' \
		-e ':c /^gshadow:\s[^#]*$/ s/\s(systemd)\s+\[!?[A-Za-z]+=[A-Za-z]+\](\s|$)/\2/g ; t c' \
		-e ':d /^gshadow:\s[^#]*$/ s/\s(systemd)(\s|$)/\2/g ; t d'
fi
# End automatically added section
# Automatically added by dh_installnss/1.7
: "${DPKG_MAINTSCRIPT_PACKAGE_INSTCOUNT:=$(dpkg-query -f '${db:Status-Abbrev}\n' -W "$DPKG_MAINTSCRIPT_PACKAGE" | grep -c '^i')}"
if { [ "$1" = "remove" ] || [ "$1" = "purge" ] ; } && [ -e "${DPKG_ROOT}/etc/nsswitch.conf" ] && [ "$DPKG_MAINTSCRIPT_PACKAGE_INSTCOUNT" -eq 0 ] ; then
	sed -E -i "${DPKG_ROOT}/etc/nsswitch.conf" \
		-e ':a /^group:\s.*#/ s/(^[^#]+)\s(systemd)\s+\[!?[A-Za-z]+=[A-Za-z]+\](\s|#)/\1\3/g ; t a' \
		-e ':b /^group:\s.*#/ s/(^[^#]+)\s(systemd)(\s|#)/\1\3/g ; t b' \
		-e ':c /^group:\s[^#]*$/ s/\s(systemd)\s+\[!?[A-Za-z]+=[A-Za-z]+\](\s|$)/\2/g ; t c' \
		-e ':d /^group:\s[^#]*$/ s/\s(systemd)(\s|$)/\2/g ; t d'
fi
# End automatically added section
