Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Starts the vdr, with config and installed plugins
- description "VDR upstart script"
- author "Steffen Barszus <steffenbpunkt@gmail.com>"
- author "Lars Hanisch <dvb@flensrocker.de>"
- start on ((filesystem and started dbus and started udev and static-network-up) \
- or (stopped vdr RESULT=failed EXIT_SIGNAL=?* \
- or stopped vdr RESULT=failed EXIT_STATUS!=[02]) \
- or resume)
- stop on runlevel [!2345]
- kill timeout 60
- # "expect stop" must be enabled if "dbus2vdr --upstart" is used
- # "expect stop" must not be enabled if "dbus2vdr --upstart" is not used
- # The Upstart job will hang if you don't pay attention to this
- #expect stop
- normal exit 0
- nice -10
- pre-start script
- . /usr/lib/vdr/config-loader.sh
- if [ "$ENABLED" = "0" ] ; then
- echo "aborted (to enable the daemon, edit /etc/default/vdr)"
- exit 2
- fi
- end script
- script
- . /usr/lib/vdr/config-loader.sh
- # Set shutdown command
- test "$ENABLE_SHUTDOWN" = "1" && VDRSHUTDOWN="/usr/lib/vdr/vdr-shutdown.wrapper" \
- || VDRSHUTDOWN=""
- . /usr/lib/vdr/commands-loader.sh
- mergecommands "commands"
- mergecommands "reccmds"
- VDR_APIVERSION=$(/usr/bin/vdr -V -L/usr/bin/vdr 2>/dev/null | sed 's/.*(\(.*\)).*/\1/' | sed 's:.*/::')
- PLUGINS=$(/usr/lib/vdr/plugin-loader2 --apiversion=$VDR_APIVERSION --confdir=$PLUGIN_CFG_DIR --libdir=$PLUGIN_DIR)
- if [ -n "$LIRC" ]; then
- OPTIONS="--lirc=$LIRC $OPTIONS"
- fi
- if [ "$VFAT" = "1" ]; then
- OPTIONS="--dirnames=,,1 $OPTIONS"
- fi
- if [ "$CACHE_DIR" != "" ]; then
- OPTIONS="--cachedir=$CACHE_DIR $OPTIONS"
- fi
- if [ "$RES_DIR" != "" ]; then
- OPTIONS="--resdir=$RES_DIR $OPTIONS"
- fi
- # enable debug measures
- if [ -f /etc/init/vdr-dbg.conf ]; then
- ulimit -c unlimited
- OPTIONS="$OPTIONS --userdump"
- echo "/var/log/vdr/core.%p" > /proc/sys/kernel/core_pattern
- fi
- # set language (default by environment, else by /etc/default/vdr)
- LANG=$VDR_LANG
- LC_ALL=$VDR_LANG
- export LANG LC_ALL
- if [ -n "$VDR_CHARSET_OVERRIDE" ] ; then
- export VDR_CHARSET_OVERRIDE=$VDR_CHARSET_OVERRIDE
- fi
- export HOME=/var/lib/vdr
- eval exec /usr/bin/vdr -v $VIDEO_DIR -c $CFG_DIR -L $PLUGIN_DIR -r $REC_CMD -s $VDRSHUTDOWN -E $EPG_FILE -u $USER -g /tmp --port $SVDRP_PORT $OPTIONS "$PLUGINS" $REDIRECT
- end script
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement