#!/bin/sh
# prerm script for xivocc-installer
#
# see: dh_installdeb(1)

set -e

COMPOSE_PATH="/etc/docker/compose"
COMPOSE_FILE="docker-xivocc.yml"

case "$1" in
    remove|deconfigure)
        echo "Stopping docker containers"
        if [ -f ${COMPOSE_PATH}/${COMPOSE_FILE} ]; then
            whiptail --title "Stopping XiVOcc Services" --msgbox "The XiVOcc services will be stopped now." 8 78
            /usr/bin/xivocc-dcomp stop
        fi
    ;;

    upgrade)
    ;;

    failed-upgrade)
    ;;

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

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

#DEBHELPER#

exit 0
