#!/sbin/runscript # Copyright 1999-2003 Gentoo Technologies, Inc. # Distributed under the terms of the GNU General Public License v2 # $Header: /var/cvsroot/gentoo-x86/media-tv/freevo/files/freevo.rc6,v 1.3 2003/11/11 18:00:00 max Exp $ depend() { need net need xfs need lircd } checkconfig() { if [ -z "${freevo}" -o "${freevo}" = "no" ] && \ [ -z "${webserver}" -o "${webserver}" = "no" ] && \ [ -z "${recordserver}" -o "${recordserver}" = "no" ] ; then eerror "All services are disabled." eerror "Please check /etc/conf.d/freevo" return 1 fi sysctl -w dev.rtc.max-user-freq=1024 &> /dev/null } start() { checkconfig || return 1 if [ "${freevo}" == "daemon" ] ; then ebegin "Starting Freevo daemon" /usr/bin/freevo daemon start eend $? elif [ "${freevo}" == "yes" ]; then ebegin "Starting Freevo" if egrep -q '^display.*(x11|dga)' /etc/freevo/freevo.conf ; then /usr/bin/freevo -fs &>/dev/null & else /usr/bin/freevo start fi eend $? fi if [ "${recordserver}" == "yes" ]; then ebegin "Starting Freevo recordserver" /usr/bin/freevo recordserver start eend $? fi if [ "${webserver}" == "yes" ]; then ebegin "Starting Freevo webserver" /usr/bin/freevo webserver start eend $? fi } stop() { if [ "${webserver}" == "yes" ]; then ebegin "Stopping Freevo webserver" /usr/bin/freevo webserver stop eend $? fi if [ "${recordserver}" == "yes" ]; then ebegin "Stopping Freevo recordserver" /usr/bin/freevo recordserver stop eend $? fi if [ "${freevo}" == "daemon" ]; then ebegin "Stopping Freevo daemon" /usr/bin/freevo daemon stop eend $? elif [ "${freevo}" == "yes" ]; then ebegin "Stopping Freevo" /usr/bin/freevo stop eend $? fi }