Mercurial > pt1.oyama
annotate src/channelscan_pt1.sh @ 161:ade99239f234
Enable change phisical channel by DLNA.
author | Naoya OYAMA <naoya.oyama@gmail.com> |
---|---|
date | Wed, 12 Sep 2012 21:36:39 +0900 |
parents | 036ae90f1b01 |
children |
rev | line source |
---|---|
150
036ae90f1b01
EXPERIMENTAL: Add channel scan script.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
diff
changeset
|
1 #!/bin/bash |
036ae90f1b01
EXPERIMENTAL: Add channel scan script.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
diff
changeset
|
2 # channelscan_pt1.sh -- Scan channel info by TS. |
036ae90f1b01
EXPERIMENTAL: Add channel scan script.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
diff
changeset
|
3 # |
036ae90f1b01
EXPERIMENTAL: Add channel scan script.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
diff
changeset
|
4 # Copyright 2012 Naoya OYAMA <naoya.oyama@gmail.com> |
036ae90f1b01
EXPERIMENTAL: Add channel scan script.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
diff
changeset
|
5 # |
036ae90f1b01
EXPERIMENTAL: Add channel scan script.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
diff
changeset
|
6 # This program is free software: you can redistribute it and/or modify |
036ae90f1b01
EXPERIMENTAL: Add channel scan script.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
diff
changeset
|
7 # it under the terms of the GNU General Public License as published by |
036ae90f1b01
EXPERIMENTAL: Add channel scan script.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
diff
changeset
|
8 # the Free Software Foundation, either version 3 of the License, or |
036ae90f1b01
EXPERIMENTAL: Add channel scan script.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
diff
changeset
|
9 # (at your option) any later version. |
036ae90f1b01
EXPERIMENTAL: Add channel scan script.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
diff
changeset
|
10 # |
036ae90f1b01
EXPERIMENTAL: Add channel scan script.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
diff
changeset
|
11 # This program is distributed in the hope that it will be useful, |
036ae90f1b01
EXPERIMENTAL: Add channel scan script.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
diff
changeset
|
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of |
036ae90f1b01
EXPERIMENTAL: Add channel scan script.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
diff
changeset
|
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
036ae90f1b01
EXPERIMENTAL: Add channel scan script.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
diff
changeset
|
14 # GNU General Public License for more details. |
036ae90f1b01
EXPERIMENTAL: Add channel scan script.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
diff
changeset
|
15 # |
036ae90f1b01
EXPERIMENTAL: Add channel scan script.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
diff
changeset
|
16 # You should have received a copy of the GNU General Public License |
036ae90f1b01
EXPERIMENTAL: Add channel scan script.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
diff
changeset
|
17 # along with this program. If not, see <http://www.gnu.org/licenses/>. |
036ae90f1b01
EXPERIMENTAL: Add channel scan script.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
diff
changeset
|
18 |
036ae90f1b01
EXPERIMENTAL: Add channel scan script.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
diff
changeset
|
19 TMP="/var/tmp" |
036ae90f1b01
EXPERIMENTAL: Add channel scan script.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
diff
changeset
|
20 ISDBT_Time="16" |
036ae90f1b01
EXPERIMENTAL: Add channel scan script.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
diff
changeset
|
21 BS_Time="60" |
036ae90f1b01
EXPERIMENTAL: Add channel scan script.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
diff
changeset
|
22 CS_Time="60" |
036ae90f1b01
EXPERIMENTAL: Add channel scan script.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
diff
changeset
|
23 |
036ae90f1b01
EXPERIMENTAL: Add channel scan script.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
diff
changeset
|
24 ISDBT_Info=~/.recpt1_ISDB |
036ae90f1b01
EXPERIMENTAL: Add channel scan script.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
diff
changeset
|
25 BS_Info=~/.recpt1_BS |
036ae90f1b01
EXPERIMENTAL: Add channel scan script.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
diff
changeset
|
26 CS_Info=~/.recpt1_CS |
036ae90f1b01
EXPERIMENTAL: Add channel scan script.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
diff
changeset
|
27 |
036ae90f1b01
EXPERIMENTAL: Add channel scan script.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
diff
changeset
|
28 for i in ${ISDBT_Info} ${BS_Info} ${CS_Info}; do |
036ae90f1b01
EXPERIMENTAL: Add channel scan script.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
diff
changeset
|
29 test -e "${i}" && rm -f "${i}" |
036ae90f1b01
EXPERIMENTAL: Add channel scan script.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
diff
changeset
|
30 done |
036ae90f1b01
EXPERIMENTAL: Add channel scan script.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
diff
changeset
|
31 |
036ae90f1b01
EXPERIMENTAL: Add channel scan script.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
diff
changeset
|
32 echo "Start ISDB-T scan." |
036ae90f1b01
EXPERIMENTAL: Add channel scan script.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
diff
changeset
|
33 for i in `seq 13 62` ; do |
036ae90f1b01
EXPERIMENTAL: Add channel scan script.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
diff
changeset
|
34 TSFILE="${TMP}/$i.ts" |
036ae90f1b01
EXPERIMENTAL: Add channel scan script.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
diff
changeset
|
35 XMLFILE="${TMP}/$i.xml" |
036ae90f1b01
EXPERIMENTAL: Add channel scan script.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
diff
changeset
|
36 recpt1 $i ${ISDBT_Time} "${TSFILE}" >/dev/null 2>&1 |
036ae90f1b01
EXPERIMENTAL: Add channel scan script.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
diff
changeset
|
37 epgdump $i "${TSFILE}" "${XMLFILE}" |
036ae90f1b01
EXPERIMENTAL: Add channel scan script.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
diff
changeset
|
38 if [ -e "${XMLFILE}" ] ; then |
036ae90f1b01
EXPERIMENTAL: Add channel scan script.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
diff
changeset
|
39 epgdump_xml_parse.pl "${XMLFILE}" >> ${ISDBT_Info} 2>/dev/null |
036ae90f1b01
EXPERIMENTAL: Add channel scan script.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
diff
changeset
|
40 rm -f "${TSFILE}" "${XMLFILE}" |
036ae90f1b01
EXPERIMENTAL: Add channel scan script.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
diff
changeset
|
41 else |
036ae90f1b01
EXPERIMENTAL: Add channel scan script.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
diff
changeset
|
42 rm -f "${TSFILE}" |
036ae90f1b01
EXPERIMENTAL: Add channel scan script.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
diff
changeset
|
43 fi |
036ae90f1b01
EXPERIMENTAL: Add channel scan script.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
diff
changeset
|
44 done |
036ae90f1b01
EXPERIMENTAL: Add channel scan script.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
diff
changeset
|
45 |
036ae90f1b01
EXPERIMENTAL: Add channel scan script.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
diff
changeset
|
46 echo "start BS scan." |
036ae90f1b01
EXPERIMENTAL: Add channel scan script.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
diff
changeset
|
47 TSFILE="${TMP}/BS.ts" |
036ae90f1b01
EXPERIMENTAL: Add channel scan script.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
diff
changeset
|
48 XMLFILE="${TMP}/BS.xml" |
036ae90f1b01
EXPERIMENTAL: Add channel scan script.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
diff
changeset
|
49 recpt1 101 ${BS_Time} "${TSFILE}" >/dev/null 2>&1 |
036ae90f1b01
EXPERIMENTAL: Add channel scan script.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
diff
changeset
|
50 epgdump /BS "${TSFILE}" "${XMLFILE}" |
036ae90f1b01
EXPERIMENTAL: Add channel scan script.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
diff
changeset
|
51 if [ -e "${XMLFILE}" ] ; then |
036ae90f1b01
EXPERIMENTAL: Add channel scan script.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
diff
changeset
|
52 epgdump_xml_parse.pl "${XMLFILE}" > ${BS_Info} 2>/dev/null |
036ae90f1b01
EXPERIMENTAL: Add channel scan script.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
diff
changeset
|
53 rm -f "${TSFILE}" "${XMLFILE}" |
036ae90f1b01
EXPERIMENTAL: Add channel scan script.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
diff
changeset
|
54 else |
036ae90f1b01
EXPERIMENTAL: Add channel scan script.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
diff
changeset
|
55 rm -f "${TSFILE}" |
036ae90f1b01
EXPERIMENTAL: Add channel scan script.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
diff
changeset
|
56 fi |
036ae90f1b01
EXPERIMENTAL: Add channel scan script.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
diff
changeset
|
57 |
036ae90f1b01
EXPERIMENTAL: Add channel scan script.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
diff
changeset
|
58 echo "start CS scan." |
036ae90f1b01
EXPERIMENTAL: Add channel scan script.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
diff
changeset
|
59 for i in `seq 1 12` ; do |
036ae90f1b01
EXPERIMENTAL: Add channel scan script.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
diff
changeset
|
60 i=$((i*2)); |
036ae90f1b01
EXPERIMENTAL: Add channel scan script.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
diff
changeset
|
61 TSFILE="${TMP}/CS.ts" |
036ae90f1b01
EXPERIMENTAL: Add channel scan script.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
diff
changeset
|
62 XMLFILE="${TMP}/CS.xml" |
036ae90f1b01
EXPERIMENTAL: Add channel scan script.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
diff
changeset
|
63 recpt1 CS$i ${CS_Time} "${TSFILE}" > /dev/null 2>&1 |
036ae90f1b01
EXPERIMENTAL: Add channel scan script.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
diff
changeset
|
64 epgdump /CS "${TSFILE}" "${XMLFILE}" |
036ae90f1b01
EXPERIMENTAL: Add channel scan script.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
diff
changeset
|
65 if [ -e "${XMLFILE}" ] ; then |
036ae90f1b01
EXPERIMENTAL: Add channel scan script.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
diff
changeset
|
66 epgdump_xml_parse.pl "${XMLFILE}" >> ${CS_Info} 2>/dev/null |
036ae90f1b01
EXPERIMENTAL: Add channel scan script.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
diff
changeset
|
67 rm -f "${TSFILE}" "${XMLFILE}" |
036ae90f1b01
EXPERIMENTAL: Add channel scan script.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
diff
changeset
|
68 else |
036ae90f1b01
EXPERIMENTAL: Add channel scan script.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
diff
changeset
|
69 rm -f "${TSFILE}" |
036ae90f1b01
EXPERIMENTAL: Add channel scan script.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
diff
changeset
|
70 fi |
036ae90f1b01
EXPERIMENTAL: Add channel scan script.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
diff
changeset
|
71 done |
036ae90f1b01
EXPERIMENTAL: Add channel scan script.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
diff
changeset
|
72 if [ -e ${CS_Info} ] ; then |
036ae90f1b01
EXPERIMENTAL: Add channel scan script.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
diff
changeset
|
73 sort -n ${CS_Info} | uniq > ${CS_Info}.tmp |
036ae90f1b01
EXPERIMENTAL: Add channel scan script.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
diff
changeset
|
74 mv -f ${CS_Info}.tmp ${CS_Info} |
036ae90f1b01
EXPERIMENTAL: Add channel scan script.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
diff
changeset
|
75 fi |
036ae90f1b01
EXPERIMENTAL: Add channel scan script.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
diff
changeset
|
76 |
036ae90f1b01
EXPERIMENTAL: Add channel scan script.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
diff
changeset
|
77 test -e ~/.recpt1-channels && mv ~/.recpt1-channels ~/.recpt1-channels_`date +%Y%m%d%H%M%S` |
036ae90f1b01
EXPERIMENTAL: Add channel scan script.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
diff
changeset
|
78 if [ -e ${ISDB_Info} ] ; then |
036ae90f1b01
EXPERIMENTAL: Add channel scan script.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
diff
changeset
|
79 echo ---------------------ISDB-T------------------------ > ~/.recpt1-channels |
036ae90f1b01
EXPERIMENTAL: Add channel scan script.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
diff
changeset
|
80 echo SID,channel,name >> ~/.recpt1-channels |
036ae90f1b01
EXPERIMENTAL: Add channel scan script.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
diff
changeset
|
81 cat ${ISDBT_Info} >> ~/.recpt1-channels |
036ae90f1b01
EXPERIMENTAL: Add channel scan script.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
diff
changeset
|
82 fi |
036ae90f1b01
EXPERIMENTAL: Add channel scan script.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
diff
changeset
|
83 if [ -e ${BS_Info} ] ; then |
036ae90f1b01
EXPERIMENTAL: Add channel scan script.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
diff
changeset
|
84 echo -----------------------BS-------------------------- >> ~/.recpt1-channels |
036ae90f1b01
EXPERIMENTAL: Add channel scan script.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
diff
changeset
|
85 echo SID,channel,name >> ~/.recpt1-channels |
036ae90f1b01
EXPERIMENTAL: Add channel scan script.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
diff
changeset
|
86 cat ${BS_Info} >> ~/.recpt1-channels |
036ae90f1b01
EXPERIMENTAL: Add channel scan script.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
diff
changeset
|
87 fi |
036ae90f1b01
EXPERIMENTAL: Add channel scan script.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
diff
changeset
|
88 if [ -e ${CS_Info} ] ; then |
036ae90f1b01
EXPERIMENTAL: Add channel scan script.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
diff
changeset
|
89 echo -----------------------CS-------------------------- >> ~/.recpt1-channels |
036ae90f1b01
EXPERIMENTAL: Add channel scan script.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
diff
changeset
|
90 echo SID,channel,name >> ~/.recpt1-channels |
036ae90f1b01
EXPERIMENTAL: Add channel scan script.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
diff
changeset
|
91 cat ${CS_Info} >> ~/.recpt1-channels |
036ae90f1b01
EXPERIMENTAL: Add channel scan script.
Naoya OYAMA <naoya.oyama@gmail.com>
parents:
diff
changeset
|
92 fi |