Mailing List archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[vdr] Re: R: Re: R: Re: bash problem in runvdr



On Wed, Apr 09, 2003 at 05:47:07PM +0200, Dr. Werner Fink wrote:
> > notice that the douple quotes do not fit together any more.
> 
> Yep. Maybe the script attached may work. It uses the vdr
> program as login shell (therefore the full path is required!).
> Usage at your own risk ;^)
> 
>        Werner
> 
> 
> -- Binary/unsupported file stripped by Listar --
> -- Type: application/x-troff-me
> -- Desc: runvdr

I'd like to know why mutt uses application/x-troff-me for a
simple shell script. Neverhthe less: usage at you own risk.

---------------------------------------------------------------------------
#!/bin/sh

# runvdr: Loads the DVB driver and runs VDR
#
# If VDR exits abnormally, the driver will be reloaded
# and VDR restarted.
#
# Set the environment variable VDRUSR to the user id you
# want VDR to run with. If VDRUSR is not set, VDR will run
# as 'root', which is not necessarily advisable.
#
# Since this script loads the DVB driver, it must be started
# as user 'root'.
#
# Any command line parameters will be passed on to the
# actual 'vdr' program.
#
# See the main source file 'vdr.c' for copyright information and
# how to reach the author.
#
# $Id: runvdr 1.9 2002/03/16 16:22:12 kls Exp $

OIFS="$IFS"
: ${VDRUSR:=root}

DVBDIR="../DVB/driver"
PLGDIR="/video/plugins"
KILL="/usr/bin/killall -q -TERM"

# Full path to VDR binary, e.g. /usr/local/bin/vdr
VDRPRG="$PWD/vdr"

# Options to VDR
IFS=:
VDROPT="-w60:$*"
IFS="$OIFS"

# Modules and their options
VDROPT="$VDROPT:-Pmp3 -m $PLGDIR/mount.sh"
VDROPT="$VDROPT:-Pmplayer -m $PLGDIR/mount.sh -M $PLGDIR/mplayer.sh"

# Load driver if it hasn't been loaded already
LSMOD=$(/sbin/lsmod | grep -cw '^dvb')
if test $LSMOD -eq 0 ; then
   (cd $DVBDIR; make insmod)
   fi

while true; do
      IFS=:
      su -s $VDRPRG -- $VDRUSR $VDROPT && exit 0
      IFS="$OIFS"
      date
      echo "restarting VDR"
      $KILL $VDRPRG
      sleep 10
      (cd $DVBDIR; make rmmod; make insmod)
      date
      done
---------------------------------------------------------------------------


-- 
Info:
To unsubscribe send a mail to listar@linuxtv.org with "unsubscribe vdr" as subject.



Home | Main Index | Thread Index