#!/bin/bash

# config section

CHANNELS=/etc/vdr/channels.conf
IMAGES=/etc/vdr/plugins/text2skin/liquid-logos4anthra_HD/	# last slash is important
IMAGE_EXTENSION=".png"

# end config section

COUNTNOIMAGE=0
# read any line from channels.conf
while read line
do
  # check if it start with ':' so it is a group
  if [ "${line:0:1}" = ":" ]
  then
    continue
  fi

  # get the channel name
  CHAN=${line%%;*}

  # test if there is an image with CHAN name
  if [ ! -e "${IMAGES}${CHAN}${IMAGE_EXTENSION}" ]
  then
    echo "there is no imiage for channel: $CHAN"
    let COUNTNOIMAGE=$COUNTNOIMAGE+1
  fi
done < $CHANNELS

echo ""
echo "$COUNTNOIMAGE missing images"
