From 50cfbf7df4826d80d9f7740c1bddc00b21125350 Mon Sep 17 00:00:00 2001 From: Manuel Reimer Date: Wed, 2 Oct 2013 16:17:08 +0200 Subject: Added new project page URL --- runvdr | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'runvdr') diff --git a/runvdr b/runvdr index b6f80cf..ba21573 100755 --- a/runvdr +++ b/runvdr @@ -21,7 +21,8 @@ # # The author can be reached at # -# The project's page is at http://www.udo-richter.de/vdr/scripts.html#runvdr +# The project's page is at +# http://projects.vdr-developer.org/projects/runvdr-extreme RUNVDRCONF="" -- cgit v1.2.3 From 81c75e2df9d71b11393c661f96e21c05d02ad27a Mon Sep 17 00:00:00 2001 From: Manuel Reimer Date: Wed, 2 Oct 2013 16:18:57 +0200 Subject: Extended author and contact list --- runvdr | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'runvdr') diff --git a/runvdr b/runvdr index ba21573..ba6520b 100755 --- a/runvdr +++ b/runvdr @@ -2,7 +2,8 @@ # # runvdr extreme - configurable vdr launcher script # -# Copyright (C) 2006-2009 by Udo Richter +# Copyright (C) 2006-2009 Udo Richter +# 2013 Manuel Reimer # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License @@ -19,7 +20,8 @@ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA # Or, point your browser to http://www.gnu.org/licenses/old-licenses/gpl-2.0.html # -# The author can be reached at +# The authors can be reached at +# # # The project's page is at # http://projects.vdr-developer.org/projects/runvdr-extreme -- cgit v1.2.3 From 5dc3ff722bee6c5795f5b744208aea2f42f21a1c Mon Sep 17 00:00:00 2001 From: Manuel Reimer Date: Wed, 2 Oct 2013 16:31:44 +0200 Subject: Fixed some whitespace errors * Trailing whitespaces removed * All but one trailing newline on end of files removed * Fixed some line lengths in text files --- runvdr | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'runvdr') diff --git a/runvdr b/runvdr index ba6520b..8e9f548 100755 --- a/runvdr +++ b/runvdr @@ -314,7 +314,7 @@ function AddParams() { for i ; do ADDPARAMS[${#ADDPARAMS[*]}]="$i" done -} +} function INCLUDE() { # include different conf file(s) @@ -363,7 +363,7 @@ function LoadConfFile() { [ -z "$DVBRESTART" ] && DVBRESTART=0 [ -z "$MAXRESTARTS" ] && MAXRESTARTS=5 [ -z "$RESTARTTIME" ] && RESTARTTIME=10 - + # Compatibility: Map old ADDPARAM to new AddParams [ -n "$ADDPARAM" ] && eval "AddParams $ADDPARAM" @@ -857,14 +857,14 @@ while (true) do # Run X server that runs VDR PROXYFILE="/tmp/runvdr-$$" [ -f "$PROXYFILE" ] && rm "$PROXYFILE" - + # Pack command array into single env string: export VDRCOMMANDPROXY=`printf '%q ' "${VDRCOMMAND[@]}"` export XSTARTUP export XSHUTDOWN [ "`type -t XSTARTUP`" = "function" ] && export -f XSTARTUP [ "`type -t XSHUTDOWN`" = "function" ] && export -f XSHUTDOWN - + # Fire up X server that calls back runvdr, and run into XSERVERPROXY there eval "xinit \""$0"\" --xserver-proxy=\""$PROXYFILE"\" -- $XSERVER &" @@ -1010,5 +1010,3 @@ done # Clean up proxy file, if used [ -n "$PROXYFILE" ] && rm $PROXYFILE >&- 2>&- - - -- cgit v1.2.3 From 9a065330215cedfe18bd47aad03fcaab148daac7 Mon Sep 17 00:00:00 2001 From: Udo Richter Date: Sun, 27 Jun 2010 14:26:00 +0200 Subject: Added missing export for "VDR_CHARSET_OVERRIDE" http://www.vdr-portal.de/board1-news/board101-news-archiv/p922562-announce-runvdr-extreme-0-4/#post922562 --- runvdr | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'runvdr') diff --git a/runvdr b/runvdr index 8e9f548..7ca0e92 100755 --- a/runvdr +++ b/runvdr @@ -211,7 +211,7 @@ function Clean() { XSTARTUP= XSHUTDOWN= LANGUAGE= - VDR_CHARSET_OVERRIDE= + export VDR_CHARSET_OVERRIDE= WRAPPER= TERMTIMEOUT= KILLTIMEOUT= -- cgit v1.2.3 From d418509cdcf53a2ac5ad06f8bf88a61fd9c2dca0 Mon Sep 17 00:00:00 2001 From: Manuel Reimer Date: Wed, 2 Oct 2013 17:24:31 +0200 Subject: Replaced "closed outputs" with "redirect to /dev/null" * Fixes problem with "ps" which no longer accepts closed STDOUT in newer versions --- runvdr | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'runvdr') diff --git a/runvdr b/runvdr index 7ca0e92..1657d9e 100755 --- a/runvdr +++ b/runvdr @@ -632,10 +632,10 @@ function WaitKill() { GetChilds "$1" "$2" echo -n "Sending ${#childlist[*]} processes the TERM signal." - $KILL -TERM ${childlist[*]} >&- 2>&- + $KILL -TERM ${childlist[*]} 2>/dev/null for ((i=0;i<$3;i++)) ; do - $PS ${childlist[*]} >&- 2>&- || { echo terminated. ; return ; } + $PS ${childlist[*]} >/dev/null || { echo terminated. ; return ; } echo -n . $SLEEP 1 @@ -643,10 +643,10 @@ function WaitKill() { echo echo -n "Sending ${#childlist[*]} processes the KILL signal." - $KILL -KILL ${childlist[*]} >&- 2>&- + $KILL -KILL ${childlist[*]} 2>/dev/null for ((i=0;i<$4;i++)) ; do - $PS ${childlist[*]} >&- 2>&- || { echo terminated. ; return ; } + $PS ${childlist[*]} >/dev/null || { echo terminated. ; return ; } echo -n . $SLEEP 1 done @@ -749,7 +749,7 @@ if [ "$TERMINATE" != "0" ] ; then echo -n "Terminating runvdr (PID=$TERMINATE)" $KILL -TERM $TERMINATE while [ -z "$WAIT" ] || [ "$WAIT" -gt 0 ] ; do - $PS $TERMINATE >&- || { echo done ; break ; } + $PS $TERMINATE >/dev/null || { echo done ; break ; } echo -n "." $SLEEP 1 [ -n "$WAIT" ] && let WAIT=WAIT-1 @@ -1006,7 +1006,7 @@ while (true) do done # Clean up PID file -[ -n "$RUNVDRPID" ] && rm $RUNVDRPID >&- 2>&- +[ -n "$RUNVDRPID" ] && rm $RUNVDRPID 2>/dev/null # Clean up proxy file, if used -[ -n "$PROXYFILE" ] && rm $PROXYFILE >&- 2>&- +[ -n "$PROXYFILE" ] && rm $PROXYFILE 2>/dev/null -- cgit v1.2.3 From e348695273c0d90639b4036ff23d952447f9d617 Mon Sep 17 00:00:00 2001 From: Manuel Reimer Date: Wed, 2 Oct 2013 17:29:59 +0200 Subject: Dropped setterm * The underlying bug has been fixed with VDR 1.7.10 --- runvdr | 5 ----- 1 file changed, 5 deletions(-) (limited to 'runvdr') diff --git a/runvdr b/runvdr index 1657d9e..8a7416b 100755 --- a/runvdr +++ b/runvdr @@ -39,7 +39,6 @@ KILL="kill" SLEEP="sleep" CHVT="chvt" DATE="date" -SETTERM="setterm" # Options summary and conf file entries of runvdr: # @@ -106,7 +105,6 @@ which $KILL >/dev/null || { echo missing $KILL... >&2 ; exit 1 ; } which $SLEEP >/dev/null || { echo missing $SLEEP... >&2 ; exit 1 ; } which $CHVT >/dev/null || { echo missing $CHVT... >&2 ; exit 1 ; } which $DATE >/dev/null || { echo missing $DATE... >&2 ; exit 1 ; } -which $SETTERM >/dev/null || { echo missing $SETTERM... >&2 ; exit 1 ; } @@ -901,9 +899,6 @@ while (true) do SHORTRUNTIMES=0 fi - # Reset terminal status - [ -n "$TERMINAL" ] && $SETTERM -initialize - case "$SIG" in HUP | INT | QUIT | TERM) echo -n "Terminating by request at " ; $DATE -- cgit v1.2.3 From 3d28e13ec115fee5ca466f9a48a01f1e65befc50 Mon Sep 17 00:00:00 2001 From: Manuel Reimer Date: Wed, 2 Oct 2013 17:32:08 +0200 Subject: Default to "vdr" in $PATH if no VDRPRG is given --- runvdr | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'runvdr') diff --git a/runvdr b/runvdr index 8a7416b..4c3a428 100755 --- a/runvdr +++ b/runvdr @@ -199,7 +199,7 @@ function Clean() { ADDPARAMS=() PLUGINSETUPCONF= SETUPPLUGINCONF= - VDRPRG= + VDRPRG=vdr SWITCHTERMINAL= XSERVER= RUNVDRPID= -- cgit v1.2.3 From 1172a51f1c9c1937c087a2da2e0886a008fc8864 Mon Sep 17 00:00:00 2001 From: Manuel Reimer Date: Thu, 3 Oct 2013 17:24:42 +0200 Subject: Added support for the --dirnames switch --- runvdr | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'runvdr') diff --git a/runvdr b/runvdr index 4c3a428..eb0a4d8 100755 --- a/runvdr +++ b/runvdr @@ -76,6 +76,7 @@ DATE="date" # -c # --config # CONFIGDIR read config files from DIR # -d --daemon DAEMON run in daemon mode # -D # --device # DVBDEVICE use only the given DVB device (NUM = 0, 1, 2...) +# --dirnames # DIRNAMES Changes recording directory name format # -E # --epgfile # EPGFILE write the EPG data into the given FILE. - to disable. # -g # --grab # GRAB write images from the SVDRP command GRAB into the given DIR; # -L # --lib # LIBDIR search for plugins in DIR (default is %s) @@ -119,7 +120,7 @@ function ParseCommandLine_Step1() { runvdr-pid:,dvb-load:,dvb-unload:,dvb-unload-on-exit,x-startup:,\ x-shutdown:,language:,charset-override:,wrapper:,\ term-timeout:,kill-timeout:,terminate::,restart::,dvb-restart::,\ - wait::,audio:,config:,daemon,device:,epgfile:,grab:,help,lib:,lirc::,\ + wait::,audio:,config:,daemon,device:,dirnames:,epgfile:,grab:,help,lib:,lirc::,\ instance:,log:,localedir:,mute,no-kbd,plugin:,port:,rcu::,record:,shutdown:,\ terminal:,user:,userdump,version,vfat,video:,watchdog:" @@ -161,6 +162,7 @@ function ParseCommandLine_Step1() { -c|--config) shift 2;; -d|--daemon) shift ;; -D|--device) shift 2;; + --dirnames) shift 2;; -E|--epgfile) shift 2;; -g|--grab) shift ;; -i|--instance) shift 2;; @@ -226,6 +228,7 @@ function Clean() { CONFIGDIR= DAEMON= DVBDEVICE=() + DIRNAMES= EPGFILE= GRAB= INSTANCE= @@ -409,6 +412,7 @@ function ParseCommandLine_Step2() { -c|--config) CONFIGDIR="$2"; shift 2;; -d|--daemon) DAEMON=1; shift ;; -D|--device) AddDevice "$2"; shift 2;; + --dirnames) DIRNAMES="$2"; shift 2;; -E|--epgfile) EPGFILE="$2"; shift 2;; -g|--grab) GRAB="1"; shift ;; -i|--instance) INSTANCE="$2"; shift 2;; @@ -489,6 +493,13 @@ Parsed VDR options: -D # --device=# use only the given DVB device (NUM = 0, 1, 2...) Use '-' to override devices from config file Use '-x' to ignore device x from config file + --dirnames=PATH[,NAME[,ENC]] + set the maximum directory path length to PATH; if NAME is + also given, it defines the maximum directory name length; + the optional ENC can be 0 or 1, and controls whether + special characters in directory names are encoded as + hex values (default: 0); if PATH or NAME are left empty + (as in ",,1" to only set ENC), the defaults apply -E # --epgfile=# write the EPG data into the given FILE. - to disable. -g # --grab=# write images from the SVDRP command GRAB into the given DIR -i # --instance=# use ID as the id of this VDR instance @@ -508,7 +519,7 @@ Parsed VDR options: -t # --terminal=# controlling tty -u # --user=# run as user USER; only applicable if started as root --userdump allow coredumps if -u is given (debugging) - --vfat encode special characters in recording names + --vfat for backwards compatibility (same as --dirnames=250,40,1) -v # --video=# use DIR as video directory -w # --watchdog=# activate the watchdog timer with a timeout of SEC @@ -553,6 +564,7 @@ function BuildCommand() { [ -n "$i" ] && AddCommandLine -D "$i" done + [ -n "$DIRNAMES" ] && AddCommandLine --dirnames="$DIRNAMES" [ -n "$EPGFILE" ] && AddCommandLine -E "$EPGFILE" [ -n "$GRAB" ] && AddCommandLine -g "$GRAB" [ -n "$INSTANCE" ] && AddCommandLine -i "$INSTANCE" -- cgit v1.2.3 From fb2d3882a8ee38e00a1321c3307df8c5ff6a131b Mon Sep 17 00:00:00 2001 From: Manuel Reimer Date: Thu, 3 Oct 2013 17:53:21 +0200 Subject: Added support for --cachedir and --resdir --- runvdr | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) (limited to 'runvdr') diff --git a/runvdr b/runvdr index eb0a4d8..34231a9 100755 --- a/runvdr +++ b/runvdr @@ -73,10 +73,11 @@ DATE="date" # Supported options of VDR # # -a # --audio # AUDIO send Dolby Digital audio to stdin of command # +# --cachedir=# CACHEDIR save cache files in DIR # -c # --config # CONFIGDIR read config files from DIR # -d --daemon DAEMON run in daemon mode # -D # --device # DVBDEVICE use only the given DVB device (NUM = 0, 1, 2...) -# --dirnames # DIRNAMES Changes recording directory name format +# --dirnames=# DIRNAMES Changes recording directory name format # -E # --epgfile # EPGFILE write the EPG data into the given FILE. - to disable. # -g # --grab # GRAB write images from the SVDRP command GRAB into the given DIR; # -L # --lib # LIBDIR search for plugins in DIR (default is %s) @@ -90,6 +91,7 @@ DATE="date" # -p # --port # SVDRPPORT use PORT for SVDRP # --rcu #? RCU use a remote control device, attached to PATH # -r # --record # RECORDCMD call CMD before and after a recording +# --resdir=# RESDIR read resource files from DIR # -s # --shutdown # SHUTDOWN call CMD to shutdown the computer # -t # --terminal # TERMINAL controlling tty # -u # --user # USER run as user USER; only applicable if started as root @@ -120,8 +122,8 @@ function ParseCommandLine_Step1() { runvdr-pid:,dvb-load:,dvb-unload:,dvb-unload-on-exit,x-startup:,\ x-shutdown:,language:,charset-override:,wrapper:,\ term-timeout:,kill-timeout:,terminate::,restart::,dvb-restart::,\ - wait::,audio:,config:,daemon,device:,dirnames:,epgfile:,grab:,help,lib:,lirc::,\ - instance:,log:,localedir:,mute,no-kbd,plugin:,port:,rcu::,record:,shutdown:,\ + wait::,audio:,cachedir:,config:,daemon,device:,dirnames:,epgfile:,grab:,help,lib:,lirc::,\ + instance:,log:,localedir:,mute,no-kbd,plugin:,port:,rcu::,record:,resdir:,shutdown:,\ terminal:,user:,userdump,version,vfat,video:,watchdog:" # prepare all optios for later processing @@ -159,6 +161,7 @@ function ParseCommandLine_Step1() { -V|--version) shift ;; -a|--audio) shift 2;; + --cachedir) shift 2;; -c|--config) shift 2;; -d|--daemon) shift ;; -D|--device) shift 2;; @@ -176,6 +179,7 @@ function ParseCommandLine_Step1() { -P|--plugin) shift 2;; --rcu) shift 2;; -r|--record) shift 2;; + --resdir) shift 2;; -s|--shutdown) shift 2;; -t|--terminal) shift 2;; -u|--user) shift 2;; @@ -225,6 +229,7 @@ function Clean() { VERSION= AUDIO= + CACHEDIR= CONFIGDIR= DAEMON= DVBDEVICE=() @@ -241,6 +246,7 @@ function Clean() { PLUGINS=() SVDRPPORT= RECORDCMD= + RESDIR= RCU= SHUTDOWN= TERMINAL= @@ -409,6 +415,7 @@ function ParseCommandLine_Step2() { -a|--audio) AUDIO="$2"; shift 2;; + --cachedir) CACHEDIR="$2"; shift 2;; -c|--config) CONFIGDIR="$2"; shift 2;; -d|--daemon) DAEMON=1; shift ;; -D|--device) AddDevice "$2"; shift 2;; @@ -426,6 +433,7 @@ function ParseCommandLine_Step2() { -P|--plugin) AddPluginString "$2"; shift 2;; --rcu) RCU="$2"; shift 2;; -r|--record) RECORDCMD="$2"; shift 2;; + --resdir) RESDIR="$2"; shift 2;; -s|--shutdown) SHUTDOWN="$2"; shift 2;; -t|--terminal) TERMINAL="$2"; shift 2;; -u|--user) USER="$2"; shift 2;; @@ -488,6 +496,7 @@ runvdr Options: Parsed VDR options: -a # --audio=# send Dolby Digital audio to stdin of command CMD + --cachedir=# save cache files in DIR -c # --config=# read config files from DIR -d --daemon run in daemon mode -D # --device=# use only the given DVB device (NUM = 0, 1, 2...) @@ -515,6 +524,7 @@ Parsed VDR options: -p # --port=# use PORT for SVDRP --rcu[=#] use a remote control device, attached to PATH -r # --record=# call CMD before and after a recording + --resdir=# read resource files from DIR -s # --shutdown=# call CMD to shutdown the computer -t # --terminal=# controlling tty -u # --user=# run as user USER; only applicable if started as root @@ -557,6 +567,7 @@ function BuildCommand() { [ "${#ADDPARAMS[*]}" -gt 0 ] && AddCommandLine "${ADDPARAMS[@]}" [ -n "$AUDIO" ] && AddCommandLine -a "$AUDIO" + [ -n "$CACHEDIR" ] && AddCommandLine --cachedir="$CACHEDIR" [ -n "$CONFIGDIR" ] && AddCommandLine -c "$CONFIGDIR" [ -n "$DAEMON" ] && AddCommandLine -d @@ -603,6 +614,7 @@ function BuildCommand() { *) AddCommandLine --rcu="$RCU";; esac + [ -n "$RESDIR" ] && AddCommandLine --resdir="$RESDIR" [ -n "$SHUTDOWN" ] && AddCommandLine -s "$SHUTDOWN" [ -n "$TERMINAL" ] && AddCommandLine -t "$TERMINAL" [ -n "$USER" ] && AddCommandLine -u "$USER" -- cgit v1.2.3 From 62fe9deb4e7edc755c4be49aa074dc952b532023 Mon Sep 17 00:00:00 2001 From: Manuel Reimer Date: Sun, 6 Oct 2013 17:03:15 +0200 Subject: "kill" is a bash builtin since at least version 1.14.7 --- runvdr | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'runvdr') diff --git a/runvdr b/runvdr index 34231a9..8fbbd84 100755 --- a/runvdr +++ b/runvdr @@ -35,7 +35,6 @@ RUNVDRCONF="" PGREP="pgrep" PS="ps" GETOPT="getopt" -KILL="kill" SLEEP="sleep" CHVT="chvt" DATE="date" @@ -104,7 +103,6 @@ DATE="date" which $PGREP >/dev/null || { echo missing $PGREP... >&2 ; exit 1 ; } which $PS >/dev/null || { echo missing $PS... >&2 ; exit 1 ; } which $GETOPT >/dev/null || { echo missing $GETOPT... >&2 ; exit 1 ; } -which $KILL >/dev/null || { echo missing $KILL... >&2 ; exit 1 ; } which $SLEEP >/dev/null || { echo missing $SLEEP... >&2 ; exit 1 ; } which $CHVT >/dev/null || { echo missing $CHVT... >&2 ; exit 1 ; } which $DATE >/dev/null || { echo missing $DATE... >&2 ; exit 1 ; } @@ -654,7 +652,7 @@ function WaitKill() { GetChilds "$1" "$2" echo -n "Sending ${#childlist[*]} processes the TERM signal." - $KILL -TERM ${childlist[*]} 2>/dev/null + kill -TERM ${childlist[*]} 2>/dev/null for ((i=0;i<$3;i++)) ; do $PS ${childlist[*]} >/dev/null || { echo terminated. ; return ; } @@ -665,7 +663,7 @@ function WaitKill() { echo echo -n "Sending ${#childlist[*]} processes the KILL signal." - $KILL -KILL ${childlist[*]} 2>/dev/null + kill -KILL ${childlist[*]} 2>/dev/null for ((i=0;i<$4;i++)) ; do $PS ${childlist[*]} >/dev/null || { echo terminated. ; return ; } @@ -769,7 +767,7 @@ fi if [ "$TERMINATE" != "0" ] ; then if [ -n "$TERMINATE" ] ; then echo -n "Terminating runvdr (PID=$TERMINATE)" - $KILL -TERM $TERMINATE + kill -TERM $TERMINATE while [ -z "$WAIT" ] || [ "$WAIT" -gt 0 ] ; do $PS $TERMINATE >/dev/null || { echo done ; break ; } echo -n "." @@ -787,7 +785,7 @@ fi if [ "$RESTART" != "0" ] ; then if [ -n "$RESTART" ] ; then echo -n "Restarting runvdr (PID=$RESTART)..." - $KILL -USR1 $RESTART + kill -USR1 $RESTART echo "" else echo "No runvdr process to restart." @@ -798,7 +796,7 @@ fi if [ "$DVBRESTART" != "0" ] ; then if [ -n "$DVBRESTART" ] ; then echo -n "DVB-restarting runvdr (PID=$DVBRESTART)..." - $KILL -USR2 $DVBRESTART + kill -USR2 $DVBRESTART echo "" else echo "No runvdr process to dvb-restart." -- cgit v1.2.3