summaryrefslogtreecommitdiff
path: root/contrib/vdr-getyearfrominfo.sh
blob: 9ffa9132d07e13514fa854001fa18ed33194a5a0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
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