#!/bin/sh -e

if [ "$1" = "upgrade" ] ; then
	if [ -d /run/systemd/system ]; then
		if [ -n "$2" ]; then
			# special case to handle <= 0.7.3 versions of the deb package
			# failing to stop krill in the prerm script so we handle it in the
			# >= 0.7.3 preinst script instead.
			case $2 in
				0.7.0*|0.7.1*|0.7.2*|0.7.3*)
					deb-systemd-invoke stop krill.service >/dev/null || true
					;;
			esac
		fi
	fi
fi

#DEBHELPER#
