diff options
Diffstat (limited to 'contrib/vdr-getyearfrominfo.sh')
-rwxr-xr-x | contrib/vdr-getyearfrominfo.sh | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/contrib/vdr-getyearfrominfo.sh b/contrib/vdr-getyearfrominfo.sh new file mode 100755 index 0000000..9ffa913 --- /dev/null +++ b/contrib/vdr-getyearfrominfo.sh @@ -0,0 +1,19 @@ +#!/bin/sh + +# old info file +infofile="$1/info.vdr" + +# use new info file if available +if [ -e "$1/info" ]; then + infofile="$1/info" +fi + +#try "|Year: XXXX|" first +year=`cat "${infofile}" | grep '|Year:' | sed -e 's/.*|Year: \([0-9]*\)|.*/\1/g'` +#echo "year1:>${year}<" + + +if [ ! "$year" == "" ]; then + echo "${year}" > "$1/year.vdr" + echo "${year}" +fi |