#!/sbin/runscript
# Copyright 1999-2004 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$

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 $?
}
