Skip to content

Instantly share code, notes, and snippets.

@msosvi
Last active December 15, 2015 02:49
Show Gist options
  • Save msosvi/5190490 to your computer and use it in GitHub Desktop.
Save msosvi/5190490 to your computer and use it in GitHub Desktop.
description "MediaTomb UPnP media server"
author "Daniel van Vugt <vanvugt in launchpad>"
start on (local-filesystems and net-device-up IFACE=wlan0)
stop on runlevel [!2345]
respawn
env CONFIGXML=/etc/mediatomb/config.xml
env LOGFILE=/var/log/mediatomb.log
env DEFAULT=/etc/default/mediatomb
script
[ -r $DEFAULT ] && . $DEFAULT
[ ! $USER ] && USER=root
[ ! $GROUP ] && GROUP=$USER
if [ -n "$INTERFACE" ]; then
INTERFACE_ARG="-e $INTERFACE"
$ROUTE_ADD $INTERFACE
fi
exec mediatomb \
-c $CONFIGXML \
-u $USER \
-g $GROUP \
-l $LOGFILE \
$INTERFACE_ARG \
$OPTIONS
end script
post-stop script
[ -r $DEFAULT ] && . $DEFAULT
if [ -n "$INTERFACE" ]; then
$ROUTE_DEL $INTERFACE
fi
end script
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment