#!/bin/bash #Put the mysql host here sqlhost="mymythtv" #Put the series title here # ex. title="Stargate SG-1" title="Series Title" #The call the script with three arguments corresponding to three episode titles # ex. que3ep "First Episode" "Second Episode" "Third Episode" mysql -umythtv -pmythtv mythconverg -h $sqlhost -e "select title,subtitle,progstart from recorded where title=\"$title\" and subtitle like \"%$1%\" UNION select title,subtitle,progstart from recorded where title=\"$title\" and subtitle like \"%$2%\" UNION select title,subtitle,progstart from recorded where title=\"$title\" and subtitle like \"%$3%\"" basename1=`mysql -umythtv -pmythtv mythconverg --skip-column-names -h $sqlhost -se "select basename from recorded where title=\"$title\" and subtitle like \"%$1%\" "` basename2=`mysql -umythtv -pmythtv mythconverg --skip-column-names -h $sqlhost -se "select basename from recorded where title=\"$title\" and subtitle like \"%$2%\" "` basename3=`mysql -umythtv -pmythtv mythconverg --skip-column-names -h $sqlhost -se "select basename from recorded where title=\"$title\" and subtitle like \"%$3%\" "` echo "Continue ? y/n" read -sn 1 x case $x in [yY]) echo "Continuing" ;; *) echo "Exiting" exit ;; esac #Start the xml file cat > mydata.xml << EOF EOF echo Created mydata.xml echo Executing mythburn.py python /usr/share/mythtv/mytharchive/scripts/mythburn.py