#!/bin/sh

set -e

case "$1" in
    upgrade)
	if dpkg --compare-versions ${2} gt 0.39.3-dmo1; then
	  echo "Starting with motionEye 0.40, the new Motion 4.x directives
	  are used in configuration files. You can either remove and re-add
	  all your cameras or you can use the migrateconf.sh script to convert
	  your configuration files:"
	  echo "for file in /etc/motioneye/{motion,thread-*}.conf; do /usr/lib/python2.7/site-packages/motioneye/scripts/migrateconf.sh $file; done"
	fi
    ;;

    abort-upgrade|abort-remove|abort-deconfigure|configure)
    ;;

    *)
        echo "postinst called with unknown argument \`$1'" >&2
        exit 1
    ;;
esac

#DEBHELPER#

exit 0
