#!/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-trans-bin/files/shoutcast_trans,v 1.4 2004/09/24 18:33:01 swegener Exp $

depend() {
        need localmount
	need shoutcast
}

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

        return 0
}

start() {
        checkconfig || return 1

        ebegin "Starting Shoutcast Trans"
        start-stop-daemon --start --quiet -m --pidfile /var/run/shoutcast_trans.pid --exec /opt/shoutcast/sc_trans_linux /etc/shoutcast/sc_trans.conf > /dev/null &
        eend $?
}

stop() {
        ebegin "Stopping Shoutcast Trans"
	start-stop-daemon --stop --quiet --pidfile /var/run/shoutcast_trans.pid
        eend $?
}
