diff options
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/create-channlelogo-symlinks.pl | 125 | ||||
-rwxr-xr-x | scripts/dia.sh | 84 | ||||
-rwxr-xr-x | scripts/noadcall.sh | 96 |
3 files changed, 305 insertions, 0 deletions
diff --git a/scripts/create-channlelogo-symlinks.pl b/scripts/create-channlelogo-symlinks.pl new file mode 100755 index 0000000..c788759 --- /dev/null +++ b/scripts/create-channlelogo-symlinks.pl @@ -0,0 +1,125 @@ +#!/usr/bin/perl + +if (not defined $ARGV[0]) {die "No parameter given! \ncreate-symlinks.pl <channels.conf> <logos> <link-dir>\n"}; +if (not defined $ARGV[1]) {die "No parameter given! \ncreate-symlinks.pl <channels.conf> <logos> <link-dir>\n"}; +if (not defined $ARGV[2]) {die "No parameter given! \ncreate-symlinks.pl <channels.conf> <logos> <link-dir>\n"}; + +my $inpath0 = "$ARGV[1]"; +my $linkpath = "$ARGV[2]"; + +%png0 = %png1 = (); + +# png folder einlesen +opendir DIR, "$inpath0" or {die " cant open $inpath0" }; + +while(my $file = readdir DIR) { + if( $file =~ /\.png$/) { + $value = $file; + $file =~ /(.*).png/; + $key = $1; + $key =~ s/\W//g; + $png0{$key} = $value; + } +} +closedir DIR; + + +open LOG, ">>translate.log" or die "Can't open log file!\n"; + +# channels.conf einlesen +open (FILE, "< $ARGV[0]") or die "Can't open file\n"; +while (<FILE>) { + $channame = $shortname = ''; + $line = $_; + $line =~ s/\r\n//; + if ($line =~ /^:/ or $line =~ /^@/ ) { next; } + + @line = split(/:/, $line); + $line[0] =~ s/\'//; + $line[0] =~ s/\///; + if ($line[0] =~ m/;/) { $line[0] =~ /(.*);.*/; $line[0] = $1 } + + if ($line[0] =~ m/,/) { + @names = split(/,/, $line[0]); + $channame = $names[0]; $shortname = $names[1]; + } + else { $channame = $line[0]; $shortname = ''; } + + if ($channame eq '' or $channame eq '.') { next; } + + $searchname = $channame; + $searchname =~ s/\W//g; + $searchname =~ tr/[A-Z]/[a-z]/; + + if ($png0{$searchname}) { + $cnt++; + $status = symlink("./../$inpath0/$png0{$searchname}","$linkpath/$channame.png"); + if ($status == 1) { print LOG "$channame => ./../$inpath0/$png0{$searchname}"; } + else { print LOG "$channame => failed"; } + if ($shortname and $shortname ne '') { + $status = symlink("./../$inpath0/$png0{$searchname}","$linkpath/$shortname.png"); + if ($status == 1) { print LOG "\t$shortname"; } + else { print LOG "\t$shortname => failed"; } + } + print LOG "\n"; next; + } + elsif ($shortname and $shortname ne '') { + + $searchname = $shortname; + $searchname =~ s/\W//g; + $searchname =~ tr/[A-Z]/[a-z]/; + + if ($png0{$searchname}) { + $cnt++; + $status = symlink("./../$inpath0/$png0{$searchname}","$linkpath/$shortname.png"); + if ($status == 1) { print LOG "$channame => ./../$inpath0/$png0{$searchname}"; } + else { print LOG "$shortname => failed"; } + if ($channame and $channame ne '') { + $status = symlink("./../$inpath0/$png0{$searchname}","$linkpath/$shortname.png"); + if ($status == 1) { print LOG "\t$channame"; } + else { print LOG "\t$channame => failed"; } + } + print LOG "\n"; next; + } + } + + $searchname = $channame; + $searchname =~ s/\W//g; + $searchname =~ tr/[A-Z]/[a-z]/; + + if ($png1{$searchname}) { + $cnt++; + $status = symlink("./../png1/$png1{$searchname}","$linkpath/$channame.png"); + if ($status == 1) { print LOG "$channame => ./../png1/$png1{$searchname}"; } + else { print LOG "$channame => failed"; } + if ($shortname and $shortname ne '') { + $status = symlink("./../png1/$png1{$searchname}","$linkpath/$shortname.png"); + if ($status == 1) { print LOG "\t$shortname"; } + else { print LOG "\t$shortname => failed"; } + } + print LOG "\n"; next; + } + elsif ($shortname and $shortname ne '') { + + $searchname = $shortname; + $searchname =~ s/\W//g; + $searchname =~ tr/[A-Z]/[a-z]/; + + if ($png1{$searchname}) { + $cnt++; + $status = symlink("./../png1/$png1{$searchname}","$linkpath/$shortname.png"); + if ($status == 1) { print LOG "$channame => ./../png1/$png1{$searchname}"; } + else { print LOG "$shortname => failed"; } + if ($channame and $channame ne '') { + $status = symlink("./../png1/$png1{$searchname}","$linkpath/$channame.png"); + if ($status == 1) { print LOG "\t$shortname"; } + else { print LOG "\t$channame => failed"; } + } + print LOG "\n"; next ; + } + } +} +close(FILE) or die "Can't close file\n"; +close(LOG) or die "Can't close file\n"; + +print $cnt, "\n"; diff --git a/scripts/dia.sh b/scripts/dia.sh new file mode 100755 index 0000000..e6e0fe5 --- /dev/null +++ b/scripts/dia.sh @@ -0,0 +1,84 @@ + +INTERVAL=10 +IMAGE_DIR="/ablage/Pictures/" +REPEAD=yes +# MOUNTPOINT=/pub/images/Pictures + +FILE="/tmp/dia.file" +LIST="/tmp/dia.list" + +# --------------------------------------------------- +# stop ?? +# --------------------------------------------------- + +if [ "$1" == "stop" ]; then + svdrpsend.pl plug graphtft VIEW Standard + rm "$LIST" + exit 0 +fi + +# --------------------------------------------------- +# check mount point (if required) +# --------------------------------------------------- + +if [ -n "$MOUNTPOINT" ]; then + check-mount.sh "$MOUNTPOINT" + + if [ "$?" == 1 ]; then + echo mount failed aborting diashow + exit 1 + fi +fi + +# --------------------------------------------------- +# create list +# --------------------------------------------------- + +echo creating image list +find $IMAGE_DIR -name *.jpg -o -name *.JPG > "$LIST" + +# --------------------------------------------------- +# switching mode +# --------------------------------------------------- + +svdrpsend.pl plug graphtft VIEW Dia + +# --------------------------------------------------- +# loop +# --------------------------------------------------- + +echo starting show ... + +while [ -f "$LIST" ]; do + + cat "$LIST" | while read i; do + + # skip thumbnails + + echo $i | grep "/\.pics/" + + if [ "$?" == 1 ]; then + echo $i + echo $i > "$FILE" + svdrpsend.pl PLUG graphtft REFRESH 2>&1 > /dev/null + + sleep $INTERVAL + else + echo skipping $i + fi + + if [ ! -f "$LIST" ]; then + break + fi + + done + + if [ "$REPEAD" != "yes" ]; then + break + fi + +done + +rm -f "$LIST" "$FILE" +exit 0 + diff --git a/scripts/noadcall.sh b/scripts/noadcall.sh new file mode 100755 index 0000000..814ece2 --- /dev/null +++ b/scripts/noadcall.sh @@ -0,0 +1,96 @@ +#!/bin/sh +# this is an example-script for a noad-call with +# different parameters for a call before or after +# a recording is done +# this script should be called from inside vdr via '-r ' +# e.g. vdr '-r /usr/local/sbin/noadcall.sh' + +# set the noad-binary here +NOAD="/usr/bin/noad" + +# set the online-mode here +# 1 means online for live-recording only +# 2 means online for every recording +ONLINEMODE="--online=1" + +# set additional args for every call here here +ADDOPTS="--ac3 --overlap --jumplogo --comments" + +# set special args for a call with 'before' here +# e.g. set a specail statistikfile +BEFOREOPTS="--statisticfile=/video0/noadonlinestat" + +# set special args for a call with 'after' here +# e.g. backup the marks from the online-call before +# so you can compare the marks and see +# how the marks vary between online-mode +# and normal scan (backup-marks are in marks0.vdr) +AFTEROPTS="--backupmarks --statisticfile=/video0/noadstat" + +# set the dir of the epg images +EPGIMG_DIR="/video0/epgimages" + +echo "noadcall.sh $*" >> /tmp/noad.log +echo "$NOAD $* $ONLINEMODE $ADDOPTS $AFTEROPTS" >> /tmp/noad.log + +case "$1" in + before) + $NOAD $* $ONLINEMODE $ADDOPTS $BEFOREOPTS + ;; + after) + # Try to copy the EPG-Image to Recording subdir + + EVENTID=`cat $2/info.vdr | sed -n -e 's/^E //p'| awk -F " " '{print $1 }'` + echo "--------------------" >> /tmp/noadcall.log + + if [ -f $EPGIMG_DIR/$EVENTID.png ]; then + cp $EPGIMG_DIR/$EVENTID.png $2/thumbnail_0.png + fi + + n=1 + + for i in $EPGIMG_DIR/${EVENTID}_*.png; do + if [ -f $i ]; then + THUMB=thumbnail_$n.png + cp $i $2/$THUMB + n=`expr $n + 1` + fi + done + + # .. other Noad/sharemarks stuff + + $NOAD $* $ONLINEMODE $ADDOPTS $AFTEROPTS + ;; + edited) + # FSK protection beim verschieben uebernehmen + + fsk=`echo $2 | sed s/"%"/""/ ` + fsk=$fsk/protection.fsk + fsknew=$2/protection.fsk + + if [ -f $fsk ]; then + touch $fsknew + fi + + # Hier muss das Bildchen verschoben werden, VDR macht nicht + + OLDREC=`echo $2 | sed s/"%"/""/ ` + + if [ -f $OLDREC/thumbnail.png ]; then + cp $OLDREC/thumbnail.png $2/ + fi + ;; + rename) + # Nothing to do. + ;; + move) + # Nothing to do. + ;; + delete) + # Nothing to do. + ;; + *) + # Nothing to do. + ;; +esac + |