#!/bin/sh

set -e

if [ "x$1" = xconfigure ]; then
        adduser --quiet --system --no-create-home --home /var/run/c-icap c-icap
        addgroup --quiet --system c-icap
        chown c-icap /var/log/c-icap
fi

# Automatically added by dh_installinit/12.7ubuntu1
if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ] || [ "$1" = "abort-deconfigure" ] || [ "$1" = "abort-remove" ] ; then
	if [ -x "/etc/init.d/c-icap" ]; then
		update-rc.d c-icap defaults >/dev/null
		if [ -n "$2" ]; then
			_dh_action=restart
		else
			_dh_action=start
		fi
		invoke-rc.d c-icap $_dh_action || exit 1
	fi
fi
# End automatically added section


exit 0
