{"id":4,"date":"2009-03-09T18:15:45","date_gmt":"2009-03-09T16:15:45","guid":{"rendered":"http:\/\/cuthbert.impire.de\/wordpress\/?p=4"},"modified":"2021-04-27T10:27:54","modified_gmt":"2021-04-27T09:27:54","slug":"bash-script-fur-tv-programm","status":"publish","type":"post","link":"https:\/\/lmaa.a-an.de\/?p=4","title":{"rendered":"Bash Script f\u00fcr TV-Programm"},"content":{"rendered":"<pre lang=\"bash\">\r\n#!\/usr\/local\/bin\/bash\r\nexport PATH=\/usr\/local\/bin:\/usr\/bin:\/bin:\\\r\n\/usr\/bin\/X11:\/usr\/games:$HOME\/bin\r\n#change +x to -x for debugging\r\nset +x\r\nXMLDIR=\"$HOME\/.xmltv\"\r\nDATE=\"date +%a\"\r\nDAY=\"date +%w\"\r\nHOST=\"user@host\"\r\nSSH=\"ssh -c blowfish-cbc user@host\"\r\nDEST=\"\/mnt\/wwwusb\/prgdata\"\r\nSCP=\"scp -pq -c blowfish-cbc\"\r\n\r\n[ -d $XMLDIR ] || mkdir -p $XMLDIR\r\n\r\nfetchprg() {\r\nXML=\"$XMLDIR\/prgdata\/prg_$($DATE)s${SOURCEID}\\\r\nd${DAYS}o${OFFSET}.xml\"\r\nnice -n 5 $HOME\/bin\/tv_grab_eu_epgdata --days $DAYS \\\r\n--offset $OFFSET --config-file $XMLDIR\/$CONFIG \\\r\n--output $XML --quiet\r\n}\r\n\r\nfetchprisma() {\r\nXML=\"$XMLDIR\/prgdata\/prg_$($DATE)s\\\r\n${SOURCEID}d${DAYS}o${OFFSET}.xml\"\r\nnice -n 5 $HOME\/bin\/tv_grab_de_prisma --quiet \\\r\n--days $DAYS --offset $OFFSET --config-file \\\r\n$XMLDIR\/$CONFIG --output $XML\r\n}\r\n\r\nputindb() {\r\nDESTXML=\"$DEST\/prg\"$SOURCEID\"d\"$DAYS\"o\"$OFFSET\".xml\"\r\nXML=\"$XMLDIR\/prgdata\/prg_$($DATE)\\\r\ns${SOURCEID}d${DAYS}o${OFFSET}.xml\"\r\nif [ -f $XML ]; then\r\n   $SCP $XML $HOST:$DESTXML\r\n   $SSH \"nice -n 5 \/usr\/bin\/mythfilldatabase --quiet \\\r\n--update --file $SOURCEID $DESTXML\"\r\nfi\r\n}\r\n\r\nsedata() {\r\nXML=\"$XMLDIR\/prgdata\/prg_$($DATE)s${SOURCEID}d${DAYS}o${OFFSET}.xml\"\r\nBAKXML=\"$XMLDIR\/prgdata\/BAK_prg_$($DATE)\\\r\ns${SOURCEID}d${DAYS}o${OFFSET}.xml\"\r\ncp $XML $BAKXML\r\ngsed -e 's\/=\"196\"\/=\"1.premiere.de\"\/g' \\\r\n-e 's\/=\"197\"\/=\"2.premiere.de\"\/g' \\\r\n-e 's\/=\"198\"\/=\"3.premiere.de\"\/g' \\\r\n-e 's\/=\"1185\"\/=\"4.premiere.de\"\/g' \\\r\n-e 's\/=\"139\"\/=\"disney.com\"\/g' \\\r\n-e 's\/=\"1189\"\/=\"nostalgie.premiere.de\"\/g' \\\r\n-e 's\/=\"166\"\/=\"krimi.premiere.de\"\/g' \\\r\n-e 's\/=\"138\"\/=\"discovery.com\"\/g' \\\r\n-e 's\/=\"160\"\/=\"junior.tv\"\/g' \\\r\n-e 's\/=\"1196\"\/=\"mgm.tv\"\/g' \\\r\n-e 's\/=\"471\"\/=\"13thstreet.nbc.com\"\/g' \\\r\n-e 's\/=\"499\"\/=\"classics.premiere.de\"\/g' \\\r\n-e 's\/=\"565\"\/=\"fox.premiere.de\"\/g' \\\r\n-e 's\/=\"589\"\/=\"nick.de\"\/g' \\\r\n-e 's\/=\"472\"\/=\"scifi.nbc.com\"\/g' \\\r\n-e 's\/=\"br.test\"\/=\"3.br-online.de\"\/g' \\\r\n-i $XML\r\n}\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>#!\/usr\/local\/bin\/bash export PATH=\/usr\/local\/bin:\/usr\/bin:\/bin:\\ \/usr\/bin\/X11:\/usr\/games:$HOME\/bin #change +x to -x for debugging set +x XMLDIR=&#8220;$HOME\/.xmltv&#8220; DATE=&#8220;date +%a&#8220; DAY=&#8220;date +%w&#8220; HOST=&#8220;user@host&#8220; SSH=&#8220;ssh -c blowfish-cbc user@host&#8220; DEST=&#8220;\/mnt\/wwwusb\/prgdata&#8220; SCP=&#8220;scp -pq -c blowfish-cbc&#8220; [ -d $XMLDIR ] || mkdir -p $XMLDIR fetchprg() { XML=&#8220;$XMLDIR\/prgdata\/prg_$($DATE)s${SOURCEID}\\ d${DAYS}o${OFFSET}.xml&#8220; nice -n 5 $HOME\/bin\/tv_grab_eu_epgdata &#8211;days $DAYS \\ &#8211;offset $OFFSET &#8211;config-file $XMLDIR\/$CONFIG \\ &#8211;output $XML &#8211;quiet } [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[],"class_list":["post-4","post","type-post","status-publish","format-standard","hentry","category-linux"],"_links":{"self":[{"href":"https:\/\/lmaa.a-an.de\/index.php?rest_route=\/wp\/v2\/posts\/4","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lmaa.a-an.de\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lmaa.a-an.de\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lmaa.a-an.de\/index.php?rest_route=\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/lmaa.a-an.de\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=4"}],"version-history":[{"count":2,"href":"https:\/\/lmaa.a-an.de\/index.php?rest_route=\/wp\/v2\/posts\/4\/revisions"}],"predecessor-version":[{"id":162,"href":"https:\/\/lmaa.a-an.de\/index.php?rest_route=\/wp\/v2\/posts\/4\/revisions\/162"}],"wp:attachment":[{"href":"https:\/\/lmaa.a-an.de\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=4"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lmaa.a-an.de\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=4"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lmaa.a-an.de\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=4"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}