#!/bin/sh -e

# Based on MPD's mpd.prerm script.

# This file is part of mpd-hits.
# Copyright (C) 2003-2005 by Warren Dukes.
# Copyright (C) Decklin Foster.
# Copyright (C) 2010 Dmitry Samoyloff.
#
# mpd-hits is free software: you can redistribute it and/or modify it under
# the terms of the GNU General Public License as published by the Free
# Software Foundation, either version 3 of the License, or (at your option)
# any later version.
#
# mpd-hits is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
# more details.
#
# You should have received a copy of the GNU General Public License along
# with mpd-hits. If not, see <http://www.gnu.org/licenses/>.

stop_mpd_hits() {
    if [ -x /etc/init.d/mpd-hits ]; then
        if [ -x /usr/sbin/invoke-rc.d ]; then
            invoke-rc.d mpd-hits stop
        else
            /etc/init.d/mpd-hits stop
        fi
    fi
}

case "$1" in
    remove|deconfigure)
        stop_mpd_hits
        ;;
    upgrade|failed-upgrade)
        ;;
    *)
        echo "prerm called with unknown argument \`$1'" >&2
        exit 0
        ;;
esac

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

#DEBHELPER#

exit 0
