#!/bin/sh

set -e

# Fix hardcoded autologin user of package pi-greeter
# See: https://github.com/raspberrypi-ui/pi-greeter/blob/master/debian/pi-greeter.postinst

if [ "$1" = "configure" ]; then
	if [ -z "$2" ]; then
		if [ -e /etc/lightdm/lightdm.conf ]; then
			sed -i -e "s/^autologin-user=pi$/#autologin-user=/" \
				/etc/lightdm/lightdm.conf
		fi
	fi
fi

#DEBHELPER#

exit 0
