#!/bin/bash
# preinst script for jolicloud-hardware
#
# see: dh_installdeb(1)

set -e

case "$1" in
    install|upgrade)
        if dpkg --compare-versions "$2" le "1.1.0" && \
           [ -e /etc/init.d/jolicloud-hardware ]; then
            # Remove the obsolete init script, now replaced by upstart.
            # Removing it here avoids creating a messy backup file like
            # /etc/init.d/jolicloud-hardware.dpkg-bak by dh_initscripts.
            rm -f "/etc/init.d/jolicloud-hardware"
        fi
        ;;

    *)
esac

# dh_installdeb will replace this with shell code automatically
# generated by other debhelper scripts.

#DEBHELPER#

exit 0
