#!/bin/bash # # Copyright (C) 2006 George Nychis (gnychis at cmu dot edu) # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 # of the License, or (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # Changes fresh prince of bel-air schedule on nick at night to the correct # schedule... brute force style # Set your mythtv username and password PASS=g1v3m3tvn0w USERNAME=mythtv # The first thing that needs to be changed is the 10:00 show ends at 10:30, not 10:35 echo SELECT \* FROM \`program\` WHERE \`chanid\`=1026 AND \`title\`=\"The Fresh Prince of Bel-Air\" AND \`starttime\` LIKE \"%22:00:00%\"\; | \ mysql --database=mythconverg --user=$USERNAME --password=$PASS | \ grep -v 'chanid' | \ awk -F" " '{print "UPDATE program SET endtime=\"" $2 " 22:30:00\" WHERE `chanid`=1026 AND `title`=\"The Fresh Prince of Bel-Air\" AND `starttime`=\"" $2, $3"\";"}' | mysql --database=mythconverg --user=$USERNAME --password=$PASS # Next we need to start the 10:35 show at 10:30 and have it end at 11:00 instead of 11:10 echo SELECT \* FROM \`program\` WHERE \`chanid\`=1026 AND \`title\`=\"The Fresh Prince of Bel-Air\" AND \`starttime\` LIKE \"%22:35:00%\"\; | \ mysql --database=mythconverg --user=$USERNAME --password=$PASS | \ grep -v 'chanid' | while read line; do echo $line | awk -F" " '{print "UPDATE program SET endtime=\"" $2 " 23:00:00\" WHERE `chanid`=1026 AND `title`=\"The Fresh Prince of Bel-Air\" AND `starttime`=\"" $2, $3"\";"}' | mysql --database=mythconverg --user=$USERNAME --password=$PASS echo $line | awk -F" " '{print "UPDATE program SET starttime=\"" $2 " 22:30:00\" WHERE `chanid`=1026 AND `title`=\"The Fresh Prince of Bel-Air\" AND `starttime`=\"" $2, $3"\";"}' | mysql --database=mythconverg --user=$USERNAME --password=$PASS done # Change the 11:10-11:45 show to 11:00-11:30 echo SELECT \* FROM \`program\` WHERE \`chanid\`=1026 AND \`title\`=\"The Fresh Prince of Bel-Air\" AND \`starttime\` LIKE \"%23:10:00%\"\; | \ mysql --database=mythconverg --user=$USERNAME --password=$PASS | \ grep -v 'chanid' | while read line; do echo $line | awk -F" " '{print "UPDATE program SET endtime=\"" $2 " 23:30:00\" WHERE `chanid`=1026 AND `title`=\"The Fresh Prince of Bel-Air\" AND `starttime`=\"" $2, $3"\";"}' | mysql --database=mythconverg --user=$USERNAME --password=$PASS echo $line | awk -F" " '{print "UPDATE program SET starttime=\"" $2 " 23:00:00\" WHERE `chanid`=1026 AND `title`=\"The Fresh Prince of Bel-Air\" AND `starttime`=\"" $2, $3"\";"}' | mysql --database=mythconverg --user=$USERNAME --password=$PASS done # Change 11:45-12:20 to 11:30-12:00 echo SELECT \* FROM \`program\` WHERE \`chanid\`=1026 AND \`title\`=\"The Fresh Prince of Bel-Air\" AND \`starttime\` LIKE \"%23:45:00%\"\; | \ mysql --database=mythconverg --user=$USERNAME --password=$PASS | \ grep -v 'chanid' | while read line; do echo $line | awk -F" " '{print "UPDATE program SET endtime=\"" $4 " 00:00:00\" WHERE `chanid`=1026 AND `title`=\"The Fresh Prince of Bel-Air\" AND `starttime`=\"" $2, $3"\";"}' | mysql --database=mythconverg --user=$USERNAME --password=$PASS echo $line | awk -F" " '{print "UPDATE program SET starttime=\"" $2 " 23:30:00\" WHERE `chanid`=1026 AND `title`=\"The Fresh Prince of Bel-Air\" AND `starttime`=\"" $2, $3"\";"}' | mysql --database=mythconverg --user=$USERNAME --password=$PASS done # Change 12:20-12:55 to 12:00-12:30 echo SELECT \* FROM \`program\` WHERE \`chanid\`=1026 AND \`title\`=\"The Fresh Prince of Bel-Air\" AND \`starttime\` LIKE \"%00:20:00%\"\; | \ mysql --database=mythconverg --user=$USERNAME --password=$PASS | \ grep -v 'chanid' | while read line; do echo $line | awk -F" " '{print "UPDATE program SET endtime=\"" $2 " 00:30:00\" WHERE `chanid`=1026 AND `title`=\"The Fresh Prince of Bel-Air\" AND `starttime`=\"" $2, $3"\";"}' | mysql --database=mythconverg --user=$USERNAME --password=$PASS echo $line | awk -F" " '{print "UPDATE program SET starttime=\"" $2 " 00:00:00\" WHERE `chanid`=1026 AND `title`=\"The Fresh Prince of Bel-Air\" AND `starttime`=\"" $2, $3"\";"}' | mysql --database=mythconverg --user=$USERNAME --password=$PASS done # Change 12:55-1:30 to 12:30-1:00 echo SELECT \* FROM \`program\` WHERE \`chanid\`=1026 AND \`title\`=\"The Fresh Prince of Bel-Air\" AND \`starttime\` LIKE \"%00:55:00%\"\; | \ mysql --database=mythconverg --user=$USERNAME --password=$PASS | \ grep -v 'chanid' | while read line; do echo $line | awk -F" " '{print "UPDATE program SET endtime=\"" $2 " 01:00:00\" WHERE `chanid`=1026 AND `title`=\"The Fresh Prince of Bel-Air\" AND `starttime`=\"" $2, $3"\";"}' | mysql --database=mythconverg --user=$USERNAME --password=$PASS echo $line | awk -F" " '{print "UPDATE program SET starttime=\"" $2 " 00:30:00\" WHERE `chanid`=1026 AND `title`=\"The Fresh Prince of Bel-Air\" AND `starttime`=\"" $2, $3"\";"}' | mysql --database=mythconverg --user=$USERNAME --password=$PASS done # Change 1:30-2:00 to 1:00-1:30 echo SELECT \* FROM \`program\` WHERE \`chanid\`=1026 AND \`title\`=\"The Fresh Prince of Bel-Air\" AND \`starttime\` LIKE \"%01:30:00%\"\; | \ mysql --database=mythconverg --user=$USERNAME --password=$PASS | \ grep -v 'chanid' | while read line; do echo $line | awk -F" " '{print "UPDATE program SET endtime=\"" $2 " 01:30:00\" WHERE `chanid`=1026 AND `title`=\"The Fresh Prince of Bel-Air\" AND `starttime`=\"" $2, $3"\";"}' | mysql --database=mythconverg --user=$USERNAME --password=$PASS echo $line | awk -F" " '{print "UPDATE program SET starttime=\"" $2 " 01:00:00\" WHERE `chanid`=1026 AND `title`=\"The Fresh Prince of Bel-Air\" AND `starttime`=\"" $2, $3"\";"}' | mysql --database=mythconverg --user=$USERNAME --password=$PASS done mythbackend --resched