#!/sbin/runscript
# Copyright 1999-2004 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/media-sound/shoutcast-server-bin/files/shoutcast,v 1.2 2004/08/14 13:38:23 swegener Exp $

depend() {
        need localmount
}

checkconfig() {
        if ! [ -f /etc/shoutcast/sc_serv.conf ] ; then
                eerror "Configuration file /etc/shoutcast/sc_serv.conf does not exist!"
                return 1
        fi

        return 0
}

start() {
        checkconfig || return 1

        ebegin "Starting Shoutcast Server"
        start-stop-daemon --start --quiet --exec /opt/shoutcast/sc_serv /etc/shoutcast/sc_serv.conf &
        eend $?
}

stop() {
        ebegin "Stopping Shoutcast Server"
        start-stop-daemon --stop --quiet --exec /opt/shoutcast/sc_serv
        eend $?
}