#!/bin/sh

set -e

if [ -d /home/scanlogd ] ; then # Clean up after #668722
	# If for some reason the directory isn't empty
	# then the directory shouldn't be unconditionally
	# removed
	rmdir --ignore-fail-on-non-empty /home/scanlogd
fi

# scanlogd needs a user
adduser --system --home /var/lib/scanlogd --no-create-home --quiet scanlogd || true

if which invoke-rc.d >/dev/null 2>&1; then
    invoke-rc.d scanlogd start
else
    /etc/init.d/scanlogd start
fi

#DEBHELPER#
