diff options
author | Heinz Wiesinger | 2011-12-19 01:46:10 +0100 |
---|---|---|
committer | Robby Workman | 2011-12-19 01:46:10 +0100 |
commit | 1fd5b2447c7c2b2759c7cded770c548854aa1b01 (patch) | |
tree | 4c934fa737a37e63c30580f4a5d97566c3f1b962 /multimedia/mediatomb/rc.mediatomb | |
parent | 6c7429dc2060957c8a3a35ef341fc40b2b361323 (diff) | |
download | slackbuilds-1fd5b2447c7c2b2759c7cded770c548854aa1b01.tar.gz |
multimedia/mediatomb: Patched for new ffmpeg and moved from Network
Signed-off-by: Robby Workman <rworkman@slackbuilds.org>
Diffstat (limited to 'multimedia/mediatomb/rc.mediatomb')
-rw-r--r-- | multimedia/mediatomb/rc.mediatomb | 80 |
1 files changed, 80 insertions, 0 deletions
diff --git a/multimedia/mediatomb/rc.mediatomb b/multimedia/mediatomb/rc.mediatomb new file mode 100644 index 0000000000..92804835b9 --- /dev/null +++ b/multimedia/mediatomb/rc.mediatomb @@ -0,0 +1,80 @@ +#!/bin/sh +# Start/stop/restart mediatomb. +# $Id: rc.mediatomb,v 1.0 2010/11/01 +# Authors: Heinz Wiesinger <pprkut@liwjatan.at> +# --------------------------------------------------------------------------- + +MEDIATOMB_PIDFILE="/var/run/mediatomb/mediatomb.pid" +MEDIATOMB_LOGFILE="/var/log/mediatomb/mediatomb.log" + +# Get additional configuration information from /etc/rc.d/rc.mediatomb.conf: +. /etc/rc.d/rc.mediatomb.conf + +mediatomb_start() +{ + echo -n "Starting mediatomb ... " + if [ -e "${MEDIATOMB_PIDFILE}" ]; then + echo "already running!" + else + if [ "${MEDIATOMB_INTERFACE}" != "" ]; then + MEDIATOMB_OPTIONS="$MEDIATOMB_OPTIONS --interface ${MEDIATOMB_INTERFACE}" + fi + if [ "${MEDIATOMB_PORT}" != "" ]; then + MEDIATOMB_OPTIONS="$MEDIATOMB_OPTIONS --port ${MEDIATOMB_PORT}" + fi + /usr/bin/mediatomb \ + --daemon \ + --user ${MEDIATOMB_USER} \ + --group ${MEDIATOMB_GROUP} \ + --pidfile ${MEDIATOMB_PIDFILE} \ + --logfile ${MEDIATOMB_LOGFILE} \ + --config ${MEDIATOMB_CONFIG} \ + ${MEDIATOMB_OPTIONS} + echo "done!" + fi +} + +mediatomb_stop() +{ + echo -n "Stopping mediatomb ... " + if [ -e "${MEDIATOMB_PIDFILE}" ]; then + kill -TERM $(cat ${MEDIATOMB_PIDFILE}) > /dev/null 2>&1 + echo "done!" + rm -f "${MEDIATOMB_PIDFILE}" + else + echo "not running!" + fi +} + +mediatomb_restart() +{ + mediatomb_stop + sleep 1 + mediatomb_start +} + +mediatomb_status() +{ + if [ -e "${MEDIATOMB_PIDFILE}" ]; then + echo "mediatomb is running!" + else + echo "mediatomb is not running!" + fi +} + +case "$1" in +'start') + mediatomb_start + ;; +'stop') + mediatomb_stop + ;; +'status') + mediatomb_status + ;; +'restart') + mediatomb_restart + ;; +*) + echo "usage $0 start|stop|restart|status" +esac |