This repository has been archived by the owner on Oct 27, 2022. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 35
/
Copy pathcombine.sh
executable file
·2126 lines (1762 loc) · 94.5 KB
/
combine.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#!/bin/bash
# Copyright (C) 2019-2020 Jan-Luca Neumann
# https://github.com/sunsettrack4/easyepg
#
# Collaborators:
# - DeBaschdi ( https://github.com/DeBaschdi )
#
# 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 3, 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.
#
# You should have received a copy of the GNU General Public License
# along with easyepg. If not, see <http://www.gnu.org/licenses/>.
# COMBINE XML SOURCE FILES
# #################
# M1300 MAIN MENU #
# #################
# M1300 MENU OVERLAY
echo 'dialog --backtitle "[M1300] EASYEPG SIMPLE XMLTV GRABBER > XML FILE CREATION" --title "SETUP MENU" --menu "Please choose:\nOption [1] to add a new setup for combined XML sources, or\nOption [2] to modify an existing one." 12 62 10 \' > /tmp/menu
# M1310 ADD
echo ' 1 "ADD SETUP MODULE" \' >> /tmp/menu
# M1320 MODIFY
if ls -l combine/ 2> /dev/null | grep -q '^d'
then
echo ' 2 "MODIFY SETUP MODULE" \' >> /tmp/menu
fi
echo "2> /tmp/value" >> /tmp/menu
bash /tmp/menu
input="$(cat /tmp/value)"
# #################
# M1310 ADD SETUP #
# #################
if grep -q "1" /tmp/value
then
rm /tmp/value
rm /tmp/setupname 2> /dev/null
until [ -s /tmp/setupname ]
do
# M1310 MENU OVERLAY
dialog --backtitle "[M1310] EASYEPG SIMPLE XMLTV GRABBER > XML FILE CREATION > ADD" --title "SETUP NAME" --inputbox "\nPlease enter a name for your setup:" 8 45 2> /tmp/setupname
while grep -q "[[:punct:] ]" /tmp/setupname
do
# M131E SPECIAL CHARACTERS
dialog --backtitle "[M131E] EASYEPG SIMPLE XMLTV GRABBER > XML FILE CREATION > ADD" --title "SETUP NAME" --inputbox "Name must not contain special symbols!\nPlease enter a name for your setup:" 8 45 2> /tmp/setupname
ls combine > /tmp/dir 2> /dev/null
echo $(</tmp/setupname) >> /tmp/dir
sort /tmp/dir | uniq -d > /tmp/dircompare
while [ -s /tmp/dircompare ]
do
# M131E DUPLICATED NAME
dialog --backtitle "[M131E] EASYEPG SIMPLE XMLTV GRABBER > XML FILE CREATION > ADD" --title "SETUP NAME" --inputbox "Name already exists for another setup!\nPlease enter a name for your setup:" 8 45 2> /tmp/setupname
ls combine > /tmp/dir 2> /dev/null
echo $(</tmp/setupname) >> /tmp/dir
sort /tmp/dir | uniq -d > /tmp/dircompare
done
done
ls combine > /tmp/dir 2> /dev/null
echo $(</tmp/setupname) >> /tmp/dir
sort /tmp/dir | uniq -d > /tmp/dircompare
while [ -s /tmp/dircompare ]
do
# M131F DUPLICATED NAME
dialog --backtitle "[M131F] EASYEPG SIMPLE XMLTV GRABBER > XML FILE CREATION > ADD" --title "SETUP NAME" --inputbox "Name already exists for another setup!\nPlease enter a name for your setup:" 8 45 2> /tmp/setupname
ls combine > /tmp/dir 2> /dev/null
echo $(</tmp/setupname) >> /tmp/dir
sort /tmp/dir | uniq -d > /tmp/dircompare
while grep -q "[[:punct:] ]" /tmp/setupname
do
# M131F SPECIAL CHARACTERS
dialog --backtitle "[M131F] EASYEPG SIMPLE XMLTV GRABBER > XML FILE CREATION > ADD" --title "SETUP NAME" --inputbox "Name must not contain special symbols!\nPlease enter a name for your setup:" 8 45 2> /tmp/setupname
ls combine > /tmp/dir 2> /dev/null
echo $(</tmp/setupname) >> /tmp/dir
sort /tmp/dir | uniq -d > /tmp/dircompare
done
done
if [ ! -s /tmp/setupname ]
then
echo "*** NO INPUT ***" > /tmp/setupname
fi
done
if grep -q "*** NO INPUT ***" /tmp/setupname
then
rm /tmp/setupname
echo "C" > /tmp/value
elif [ -s /tmp/setupname ]
then
mkdir combine 2> /dev/null
mkdir "combine/$(</tmp/setupname)"
touch /tmp/chduplicates
while [ -e /tmp/chduplicates ]
do
rm /tmp/xmlch2 2> /dev/null
# ###############
# COLLECT FILES #
# ###############
echo 'dialog --backtitle "[M1311] EASYEPG SIMPLE XMLTV GRABBER > XML FILE CREATION > ADD" --title "CHANNEL LIST" --checklist "Please choose the channels you want to grab:" 15 50 10 \' > /tmp/chmenu
if [ -e xml/horizon_de.xml ]
then
grep 'channel id=' xml/horizon_de.xml > /tmp/xmlch && cat /tmp/xmlch > /tmp/xmlch2
sed 's/<channel id="/"[HORIZON DE] /g;s/">/" "" on \\/g' /tmp/xmlch >> /tmp/chmenu
fi
if [ -e xml/horizon_at.xml ]
then
grep 'channel id=' xml/horizon_at.xml > /tmp/xmlch && cat /tmp/xmlch >> /tmp/xmlch2
sed 's/<channel id="/"[HORIZON AT] /g;s/">/" "" on \\/g' /tmp/xmlch >> /tmp/chmenu
fi
if [ -e xml/horizon_ch.xml ]
then
grep 'channel id=' xml/horizon_ch.xml > /tmp/xmlch && cat /tmp/xmlch >> /tmp/xmlch2
sed 's/<channel id="/"[HORIZON CH] /g;s/">/" "" on \\/g' /tmp/xmlch >> /tmp/chmenu
fi
if [ -e xml/horizon_nl.xml ]
then
grep 'channel id=' xml/horizon_nl.xml > /tmp/xmlch && cat /tmp/xmlch >> /tmp/xmlch2
sed 's/<channel id="/"[HORIZON NL] /g;s/">/" "" on \\/g' /tmp/xmlch >> /tmp/chmenu
fi
if [ -e xml/horizon_pl.xml ]
then
grep 'channel id=' xml/horizon_pl.xml > /tmp/xmlch && cat /tmp/xmlch >> /tmp/xmlch2
sed 's/<channel id="/"[HORIZON PL] /g;s/">/" "" on \\/g' /tmp/xmlch >> /tmp/chmenu
fi
if [ -e xml/horizon_ie.xml ]
then
grep 'channel id=' xml/horizon_ie.xml > /tmp/xmlch && cat /tmp/xmlch >> /tmp/xmlch2
sed 's/<channel id="/"[HORIZON IE] /g;s/">/" "" on \\/g' /tmp/xmlch >> /tmp/chmenu
fi
if [ -e xml/horizon_sk.xml ]
then
grep 'channel id=' xml/horizon_sk.xml > /tmp/xmlch && cat /tmp/xmlch >> /tmp/xmlch2
sed 's/<channel id="/"[HORIZON SK] /g;s/">/" "" on \\/g' /tmp/xmlch >> /tmp/chmenu
fi
if [ -e xml/horizon_cz.xml ]
then
grep 'channel id=' xml/horizon_cz.xml > /tmp/xmlch && cat /tmp/xmlch >> /tmp/xmlch2
sed 's/<channel id="/"[HORIZON CZ] /g;s/">/" "" on \\/g' /tmp/xmlch >> /tmp/chmenu
fi
if [ -e xml/horizon_hu.xml ]
then
grep 'channel id=' xml/horizon_hu.xml > /tmp/xmlch && cat /tmp/xmlch >> /tmp/xmlch2
sed 's/<channel id="/"[HORIZON HU] /g;s/">/" "" on \\/g' /tmp/xmlch >> /tmp/chmenu
fi
if [ -e xml/horizon_ro.xml ]
then
grep 'channel id=' xml/horizon_ro.xml > /tmp/xmlch && cat /tmp/xmlch >> /tmp/xmlch2
sed 's/<channel id="/"[HORIZON RO] /g;s/">/" "" on \\/g' /tmp/xmlch >> /tmp/chmenu
fi
if [ -e xml/zattoo_de.xml ]
then
grep 'channel id=' xml/zattoo_de.xml > /tmp/xmlch && cat /tmp/xmlch >> /tmp/xmlch2
sed 's/<channel id="/"[ZATTOO DE] /g;s/">/" "" on \\/g' /tmp/xmlch >> /tmp/chmenu
fi
if [ -e xml/zattoo_ch.xml ]
then
grep 'channel id=' xml/zattoo_ch.xml > /tmp/xmlch && cat /tmp/xmlch >> /tmp/xmlch2
sed 's/<channel id="/"[ZATTOO CH] /g;s/">/" "" on \\/g' /tmp/xmlch >> /tmp/chmenu
fi
if [ -e xml/swisscom_ch.xml ]
then
grep 'channel id=' xml/swisscom_ch.xml > /tmp/xmlch && cat /tmp/xmlch >> /tmp/xmlch2
sed 's/<channel id="/"[SWISSCOM CH] /g;s/">/" "" on \\/g' /tmp/xmlch >> /tmp/chmenu
fi
if [ -e xml/tvplayer_uk.xml ]
then
grep 'channel id=' xml/tvplayer_uk.xml > /tmp/xmlch && cat /tmp/xmlch >> /tmp/xmlch2
sed 's/<channel id="/"[TVPLAYER UK] /g;s/">/" "" on \\/g' /tmp/xmlch >> /tmp/chmenu
fi
if [ -e xml/magentatv_de.xml ]
then
grep 'channel id=' xml/magentatv_de.xml > /tmp/xmlch && cat /tmp/xmlch >> /tmp/xmlch2
sed 's/<channel id="/"[MAGENTATV DE] /g;s/">/" "" on \\/g' /tmp/xmlch >> /tmp/chmenu
fi
if [ -e xml/radiotimes_uk.xml ]
then
grep 'channel id=' xml/radiotimes_uk.xml > /tmp/xmlch && cat /tmp/xmlch >> /tmp/xmlch2
sed 's/<channel id="/"[RADIOTIMES UK] /g;s/">/" "" on \\/g' /tmp/xmlch >> /tmp/chmenu
fi
if [ -e xml/waipu_de.xml ]
then
grep 'channel id=' xml/waipu_de.xml > /tmp/xmlch && cat /tmp/xmlch >> /tmp/xmlch2
sed 's/<channel id="/"[WAIPU.TV DE] /g;s/">/" "" on \\/g' /tmp/xmlch >> /tmp/chmenu
fi
if [ -e xml/tv-spielfilm_de.xml ]
then
grep 'channel id=' xml/tv-spielfilm_de.xml > /tmp/xmlch && cat /tmp/xmlch >> /tmp/xmlch2
sed 's/<channel id="/"[TV-SPIELFILM DE] /g;s/">/" "" on \\/g' /tmp/xmlch >> /tmp/chmenu
fi
if [ -e xml/vodafone_de.xml ]
then
grep 'channel id=' xml/vodafone_de.xml > /tmp/xmlch && cat /tmp/xmlch >> /tmp/xmlch2
sed 's/<channel id="/"[VODAFONE DE] /g;s/">/" "" on \\/g' /tmp/xmlch >> /tmp/chmenu
fi
if [ -e xml/tvtv_us.xml ]
then
grep 'channel id=' xml/tvtv_us.xml > /tmp/xmlch && cat /tmp/xmlch >> /tmp/xmlch2
sed 's/<channel id="/"[TVTV USA] /g;s/">/" "" on \\/g' /tmp/xmlch >> /tmp/chmenu
fi
if [ -e xml/tvtv_ca.xml ]
then
grep 'channel id=' xml/tvtv_ca.xml > /tmp/xmlch && cat /tmp/xmlch >> /tmp/xmlch2
sed 's/<channel id="/"[TVTV CANADA] /g;s/">/" "" on \\/g' /tmp/xmlch >> /tmp/chmenu
fi
if [ -e xml/external_oa.xml ]
then
grep 'channel id=' xml/external_oa.xml > /tmp/xmlch && cat /tmp/xmlch >> /tmp/xmlch2
sed 's/<channel id="/"[EXTERNAL OA] /g;s/">/" "" on \\/g' /tmp/xmlch >> /tmp/chmenu
fi
echo "2>/tmp/channels" >> /tmp/chmenu
sort /tmp/xmlch2 | uniq -d > /tmp/chduplicates
sed -i 's/<channel id="//g;s/">//g' /tmp/chduplicates
if [ -s /tmp/chduplicates ]
then
dialog --backtitle "[M131W] EASYEPG SIMPLE XMLTV GRABBER > XML FILE CREATION > ADD" --title "WARNING" --msgbox "Duplicated Channel IDs exist in this setup!\nPlease remove the duplicated entries from setup.\n\nList of duplicated Channel IDs:\n\n$(</tmp/chduplicates)" 12 55 2> /tmp/value
else
rm /tmp/chduplicates
fi
sed -i 's/\&/\&/g' /tmp/chmenu
bash /tmp/chmenu
if [ ! -s /tmp/channels ]
then
rm -rf combine/$(</tmp/setupname) 2> /dev/null
rm /tmp/setupname /tmp/chduplicates 2> /dev/null
else
sed 's/\\\[/[/g;s/\\\]/]/g;s/\\(/(/g;s/\\)/)/g;s/\\\&/\&/g' /tmp/channels > /tmp/xmlch2
sed -i 's/ "\[HORIZON [A-Z][A-Z]\] /\n/g;s/"\[HORIZON [A-Z][A-Z]\] //g;s/ "\[ZATTOO [A-Z][A-Z]\] /\n/g;s/"\[ZATTOO [A-Z][A-Z]\] //g;s/ "\[SWISSCOM [A-Z][A-Z]\] /\n/g;s/"\[SWISSCOM [A-Z][A-Z]\] //g;s/ "\[TVPLAYER [A-Z][A-Z]\] /\n/g;s/"\[TVPLAYER [A-Z][A-Z]\] //g;s/ "\[MAGENTATV [A-Z][A-Z]\] /\n/g;s/"\[MAGENTATV [A-Z][A-Z]\] //g;s/ "\[RADIOTIMES [A-Z][A-Z]\] /\n/g;s/"\[RADIOTIMES [A-Z][A-Z]\] //g;s/ "\[WAIPU.TV [A-Z][A-Z]\] /\n/g;s/"\[WAIPU.TV [A-Z][A-Z]\] //g;s/ "\[TV-SPIELFILM [A-Z][A-Z]\] /\n/g;s/"\[TV-SPIELFILM [A-Z][A-Z]\] //g;s/ "\[VODAFONE [A-Z][A-Z]\] /\n/g;s/"\[VODAFONE [A-Z][A-Z]\] //g;s/ "\[TVTV [A-Z][A-Z]\] /\n/g;s/"\[TVTV [A-Z][A-Z]\] //g;s/ "\[EXTERNAL [A-Z][A-Z]\] /\n/g;s/"\[EXTERNAL [A-Z][A-Z]\] //g;s/"//g;s/"//g' /tmp/xmlch2
sort /tmp/xmlch2 | uniq -d > /tmp/chduplicates
if [ -s /tmp/chduplicates ]
then
dialog --backtitle "[M131E] EASYEPG SIMPLE XMLTV GRABBER > XML FILE CREATION > ADD" --title "ERROR" --infobox "Duplicated Channel IDs exist in this setup!" 5 40
sleep 2s
else
rm /tmp/chduplicates
fi
fi
done
# ####################
# SAVE CONFIGURATION #
# ####################
if [ -s /tmp/channels ]
then
sed -i 's/\\\[/[/g;s/\\\]/]/g;s/\\(/(/g;s/\\)/)/g;s/\\\&/\&/g;s/\\#/#/g' /tmp/channels
sed -i 's/ "\[HORIZON/\n"\[HORIZON/g;s/ "\[ZATTOO/\n"\[ZATTOO/g;s/ "\[SWISSCOM/\n"\[SWISSCOM/g;s/ "\[TVPLAYER/\n"\[TVPLAYER/g;s/ "\[MAGENTATV/\n"\[MAGENTATV/g;s/ "\[RADIOTIMES/\n"\[RADIOTIMES/g;s/ "\[WAIPU.TV/\n"\[WAIPU.TV/g;s/ "\[TV-SPIELFILM/\n"\[TV-SPIELFILM/g;s/ "\[VODAFONE/\n"\[VODAFONE/g;s/ "\[TVTV/\n"\[TVTV/g;s/ "\[EXTERNAL/\n"\[EXTERNAL/g' /tmp/channels
if [ -e /tmp/setupname ]
then
if [ -e xml/horizon_de.xml ]
then
grep "HORIZON DE" /tmp/channels | sed '/HORIZON DE/s/\[HORIZON DE\] //g;s/.*/&,/g;$s/,/]\n}/g;1i{"channels":\[' > combine/$(</tmp/setupname)/hzn_de_channels.json
fi
if [ -e xml/horizon_at.xml ]
then
grep "HORIZON AT" /tmp/channels | sed '/HORIZON AT/s/\[HORIZON AT\] //g;s/.*/&,/g;$s/,/]\n}/g;1i{"channels":\[' > combine/$(</tmp/setupname)/hzn_at_channels.json
fi
if [ -e xml/horizon_ch.xml ]
then
grep "HORIZON CH" /tmp/channels | sed '/HORIZON CH/s/\[HORIZON CH\] //g;s/.*/&,/g;$s/,/]\n}/g;1i{"channels":\[' > combine/$(</tmp/setupname)/hzn_ch_channels.json
fi
if [ -e xml/horizon_nl.xml ]
then
grep "HORIZON NL" /tmp/channels | sed '/HORIZON NL/s/\[HORIZON NL\] //g;s/.*/&,/g;$s/,/]\n}/g;1i{"channels":\[' > combine/$(</tmp/setupname)/hzn_nl_channels.json
fi
if [ -e xml/horizon_pl.xml ]
then
grep "HORIZON PL" /tmp/channels | sed '/HORIZON PL/s/\[HORIZON PL\] //g;s/.*/&,/g;$s/,/]\n}/g;1i{"channels":\[' > combine/$(</tmp/setupname)/hzn_pl_channels.json
fi
if [ -e xml/horizon_ie.xml ]
then
grep "HORIZON IE" /tmp/channels | sed '/HORIZON IE/s/\[HORIZON IE\] //g;s/.*/&,/g;$s/,/]\n}/g;1i{"channels":\[' > combine/$(</tmp/setupname)/hzn_ie_channels.json
fi
if [ -e xml/horizon_sk.xml ]
then
grep "HORIZON SK" /tmp/channels | sed '/HORIZON SK/s/\[HORIZON SK\] //g;s/.*/&,/g;$s/,/]\n}/g;1i{"channels":\[' > combine/$(</tmp/setupname)/hzn_sk_channels.json
fi
if [ -e xml/horizon_cz.xml ]
then
grep "HORIZON CZ" /tmp/channels | sed '/HORIZON CZ/s/\[HORIZON CZ\] //g;s/.*/&,/g;$s/,/]\n}/g;1i{"channels":\[' > combine/$(</tmp/setupname)/hzn_cz_channels.json
fi
if [ -e xml/horizon_hu.xml ]
then
grep "HORIZON HU" /tmp/channels | sed '/HORIZON HU/s/\[HORIZON HU\] //g;s/.*/&,/g;$s/,/]\n}/g;1i{"channels":\[' > combine/$(</tmp/setupname)/hzn_hu_channels.json
fi
if [ -e xml/horizon_ro.xml ]
then
grep "HORIZON RO" /tmp/channels | sed '/HORIZON RO/s/\[HORIZON RO\] //g;s/.*/&,/g;$s/,/]\n}/g;1i{"channels":\[' > combine/$(</tmp/setupname)/hzn_ro_channels.json
fi
if [ -e xml/zattoo_de.xml ]
then
grep "ZATTOO DE" /tmp/channels | sed '/ZATTOO DE/s/\[ZATTOO DE\] //g;s/.*/&,/g;$s/,/]\n}/g;1i{"channels":\[' > combine/$(</tmp/setupname)/ztt_de_channels.json
fi
if [ -e xml/zattoo_ch.xml ]
then
grep "ZATTOO CH" /tmp/channels | sed '/ZATTOO CH/s/\[ZATTOO CH\] //g;s/.*/&,/g;$s/,/]\n}/g;1i{"channels":\[' > combine/$(</tmp/setupname)/ztt_ch_channels.json
fi
if [ -e xml/swisscom_ch.xml ]
then
grep "SWISSCOM CH" /tmp/channels | sed '/SWISSCOM CH/s/\[SWISSCOM CH\] //g;s/.*/&,/g;$s/,/]\n}/g;1i{"channels":\[' > combine/$(</tmp/setupname)/swc_ch_channels.json
fi
if [ -e xml/tvplayer_uk.xml ]
then
grep "TVPLAYER UK" /tmp/channels | sed '/TVPLAYER UK/s/\[TVPLAYER UK\] //g;s/.*/&,/g;$s/,/]\n}/g;1i{"channels":\[' > combine/$(</tmp/setupname)/tvp_uk_channels.json
fi
if [ -e xml/magentatv_de.xml ]
then
grep "MAGENTATV DE" /tmp/channels | sed '/MAGENTATV DE/s/\[MAGENTATV DE\] //g;s/.*/&,/g;$s/,/]\n}/g;1i{"channels":\[' > combine/$(</tmp/setupname)/tkm_de_channels.json
fi
if [ -e xml/radiotimes_uk.xml ]
then
grep "RADIOTIMES UK" /tmp/channels | sed '/RADIOTIMES UK/s/\[RADIOTIMES UK\] //g;s/.*/&,/g;$s/,/]\n}/g;1i{"channels":\[' > combine/$(</tmp/setupname)/rdt_uk_channels.json
fi
if [ -e xml/waipu_de.xml ]
then
grep "WAIPU.TV DE" /tmp/channels | sed '/WAIPU.TV DE/s/\[WAIPU.TV DE\] //g;s/.*/&,/g;$s/,/]\n}/g;1i{"channels":\[' > combine/$(</tmp/setupname)/wpu_de_channels.json
fi
if [ -e xml/tv-spielfilm_de.xml ]
then
grep "TV-SPIELFILM DE" /tmp/channels | sed '/TV-SPIELFILM DE/s/\[TV-SPIELFILM DE\] //g;s/.*/&,/g;$s/,/]\n}/g;1i{"channels":\[' > combine/$(</tmp/setupname)/tvs_de_channels.json
fi
if [ -e xml/vodafone_de.xml ]
then
grep "VODAFONE DE" /tmp/channels | sed '/VODAFONE DE/s/\[VODAFONE DE\] //g;s/.*/&,/g;$s/,/]\n}/g;1i{"channels":\[' > combine/$(</tmp/setupname)/vdf_de_channels.json
fi
if [ -e xml/tvtv_us.xml ]
then
grep "TVTV USA" /tmp/channels | sed '/TVTV USA/s/\[TVTV USA\] //g;s/.*/&,/g;$s/\(.*\),/\1]\n}/g;1i{"channels":\[' > combine/$(</tmp/setupname)/tvtv_us_channels.json
fi
if [ -e xml/tvtv_ca.xml ]
then
grep "TVTV CANADA" /tmp/channels | sed '/TVTV CANADA/s/\[TVTV CANADA\] //g;s/.*/&,/g;$s/\(.*\),/\1]\n}/g;1i{"channels":\[' > combine/$(</tmp/setupname)/tvtv_ca_channels.json
fi
if [ -e xml/external_oa.xml ]
then
grep "EXTERNAL OA" /tmp/channels | sed '/EXTERNAL OA/s/\[EXTERNAL OA\] //g;s/.*/&,/g;$s/,/]\n}/g;1i{"channels":\[' > combine/$(</tmp/setupname)/ext_oa_channels.json
fi
if [ -e xml/external_ob.xml ]
then
grep "EXTERNAL OB" /tmp/channels | sed '/EXTERNAL OB/s/\[EXTERNAL OB\] //g;s/.*/&,/g;$s/,/]\n}/g;1i{"channels":\[' > combine/$(</tmp/setupname)/ext_ob_channels.json
fi
if [ -e xml/external_oc.xml ]
then
grep "EXTERNAL OC" /tmp/channels | sed '/EXTERNAL OC/s/\[EXTERNAL OC\] //g;s/.*/&,/g;$s/,/]\n}/g;1i{"channels":\[' > combine/$(</tmp/setupname)/ext_oc_channels.json
fi
echo '{"day": "14"}' > combine/$(</tmp/setupname)/settings.json
fi
dialog --backtitle "[M131S] EASYEPG SIMPLE XMLTV GRABBER > XML FILE CREATION > ADD" --title "INFO" --msgbox "New channel list added!" 5 30
else
dialog --backtitle "[M131I] EASYEPG SIMPLE XMLTV GRABBER > XML FILE CREATION > ADD" --title "INFO" --msgbox "Channel list creation aborted!\nPlease note that at least 1 channel must be included in channel list!" 7 50
fi
echo "C" > /tmp/value
fi
# ####################
# M1320 MODIFY SETUP #
# ####################
elif grep -q "2" /tmp/value
then
echo 'dialog --backtitle "[M132S] EASYEPG SIMPLE XMLTV GRABBER > XML FILE CREATION > MODIFY" --title "MODIFY SETUP" --menu "Please select the setup you want to modify:" 12 45 10 \' > /tmp/setupname
ls combine > /tmp/combine
sed 's/.*/"&" \\/g' /tmp/combine > /tmp/setupmenu
nl /tmp/setupmenu >> /tmp/setupname
echo "2> /tmp/selectedsetup" >> /tmp/setupname
bash /tmp/setupname
if [ -s /tmp/selectedsetup ]
then
echo "B" > /tmp/value
while grep -q "B" /tmp/value
do
# M1320 MENU OVERLAY
echo 'dialog --backtitle "[M1320] EASYEPG SIMPLE XMLTV GRABBER > XML FILE CREATION > MODIFY" --title "MODIFY SETUP" --menu "Please choose an option:" 13 45 10 \' > /tmp/menu
# M1321 CHANNEL LIST
echo ' 1 "MODIFY CHANNEL LIST" \' >> /tmp/menu
# M1322 ADDON SCRIPTS
echo ' 2 "USE ADDON SCRIPTS" \' >> /tmp/menu
# M1323 PRE SCRIPTS
echo ' 3 "ADD/MODIFY PRE SHELL SCRIPT" \' >> /tmp/menu
# M1324 POST SCRIPTS
echo ' 4 "ADD/MODIFY POST SHELL SCRIPT" \' >> /tmp/menu
# M1325 CREATE CHANNEL LIST
if [ -e xml/$(sed -n "$(</tmp/selectedsetup)p" /tmp/combine).xml ]
then
echo ' 5 "CREATE CHANNEL LIST AS TXT FILE" \' >> /tmp/menu
fi
# M1326 TIME PERIOD
if grep -q '"day": "10"' combine/$(sed -n "$(</tmp/selectedsetup)p" /tmp/combine)/settings.json
then
echo ' 6 "TIME PERIOD (currently: 10 days)" \' >> /tmp/menu
elif grep -q '"day": "11"' combine/$(sed -n "$(</tmp/selectedsetup)p" /tmp/combine)/settings.json
then
echo ' 6 "TIME PERIOD (currently: 11 days)" \' >> /tmp/menu
elif grep -q '"day": "12"' combine/$(sed -n "$(</tmp/selectedsetup)p" /tmp/combine)/settings.json
then
echo ' 6 "TIME PERIOD (currently: 12 days)" \' >> /tmp/menu
elif grep -q '"day": "13"' combine/$(sed -n "$(</tmp/selectedsetup)p" /tmp/combine)/settings.json
then
echo ' 6 "TIME PERIOD (currently: 13 days)" \' >> /tmp/menu
elif grep -q '"day": "14"' combine/$(sed -n "$(</tmp/selectedsetup)p" /tmp/combine)/settings.json
then
echo ' 6 "TIME PERIOD (currently: 14 days)" \' >> /tmp/menu
elif grep -q '"day": "0"' combine/$(sed -n "$(</tmp/selectedsetup)p" /tmp/combine)/settings.json
then
echo ' 6 "TIME PERIOD (disabled)" \' >> /tmp/menu
elif grep -q '"day": "1"' combine/$(sed -n "$(</tmp/selectedsetup)p" /tmp/combine)/settings.json
then
echo ' 6 "TIME PERIOD (currently: 1 day)" \' >> /tmp/menu
elif grep -q '"day": "2"' combine/$(sed -n "$(</tmp/selectedsetup)p" /tmp/combine)/settings.json
then
echo ' 6 "TIME PERIOD (currently: 2 days)" \' >> /tmp/menu
elif grep -q '"day": "3"' combine/$(sed -n "$(</tmp/selectedsetup)p" /tmp/combine)/settings.json
then
echo ' 6 "TIME PERIOD (currently: 3 days)" \' >> /tmp/menu
elif grep -q '"day": "4"' combine/$(sed -n "$(</tmp/selectedsetup)p" /tmp/combine)/settings.json
then
echo ' 6 "TIME PERIOD (currently: 4 days)" \' >> /tmp/menu
elif grep -q '"day": "5"' combine/$(sed -n "$(</tmp/selectedsetup)p" /tmp/combine)/settings.json
then
echo ' 6 "TIME PERIOD (currently: 5 days)" \' >> /tmp/menu
elif grep -q '"day": "6"' combine/$(sed -n "$(</tmp/selectedsetup)p" /tmp/combine)/settings.json
then
echo ' 6 "TIME PERIOD (currently: 6 days)" \' >> /tmp/menu
elif grep -q '"day": "7"' combine/$(sed -n "$(</tmp/selectedsetup)p" /tmp/combine)/settings.json
then
echo ' 6 "TIME PERIOD (currently: 7 days)" \' >> /tmp/menu
elif grep -q '"day": "8"' combine/$(sed -n "$(</tmp/selectedsetup)p" /tmp/combine)/settings.json
then
echo ' 6 "TIME PERIOD (currently: 8 days)" \' >> /tmp/menu
elif grep -q '"day": "9"' combine/$(sed -n "$(</tmp/selectedsetup)p" /tmp/combine)/settings.json
then
echo ' 6 "TIME PERIOD (currently: 9 days)" \' >> /tmp/menu
fi
# M1327 RUN COMBINE SCRIPT
echo ' 7 "RUN COMBINE SCRIPT" \' >> /tmp/menu
# M1329 REMOVE SETUP
echo ' 9 "REMOVE THIS SETUP" \' >> /tmp/menu
echo "2> /tmp/setupvalue" >> /tmp/menu
bash /tmp/menu
if grep -q "1" /tmp/setupvalue
then
touch /tmp/menu
while [ -e /tmp/menu ]
do
# ####################
# M1321 COLLECT DATA #
# ####################
rm /tmp/xmlch_* /tmp/channels_* /tmp/chduplicates /tmp/xmlch2 2> /dev/null
echo 'dialog --backtitle "[M1321] EASYEPG SIMPLE XMLTV GRABBER > XML FILE CREATION > MODIFY" --title "CHANNEL LIST" --checklist "Please choose the channels you want to grab:" 15 50 10 \' > /tmp/chmenu
# HORIZON DE
if [ -e xml/horizon_de.xml ]
then
grep 'channel id=' xml/horizon_de.xml > /tmp/xmlch_de
sed -i 's/<channel id="/[HORIZON DE] /g;s/">//g;s/\&/\&/g' /tmp/xmlch_de
else
rm combine/$(sed -n "$(</tmp/selectedsetup)p" /tmp/combine)/hzn_de_channels.json 2> /dev/null
fi
touch combine/$(sed -n "$(</tmp/selectedsetup)p" /tmp/combine)/hzn_de_channels.json /tmp/xmlch_de
cd combine/$(sed -n "$(</tmp/selectedsetup)p" /tmp/combine)
if [ -e hzn_de_channels.json ]
then
sed '/{"channels":\[/d;/}/d;s/",//g;s/"\]//g;s/"//g' hzn_de_channels.json > /tmp/channels_de && cat /tmp/channels_de >> /tmp/xmlch2
sed -i 's/.*/[HORIZON DE] &/g' /tmp/channels_de
comm -12 <(sort -u /tmp/xmlch_de) <(sort -u /tmp/channels_de) > /tmp/comm_menu_enabled
comm -2 -3 <(sort -u /tmp/xmlch_de) <(sort -u /tmp/channels_de) > /tmp/comm_menu_disabled
sed 's/.*/"&" "" on \\/g' /tmp/comm_menu_enabled >> /tmp/chmenu
sed 's/.*/"&" "" off \\/g' /tmp/comm_menu_disabled >> /tmp/chmenu
fi
cd - > /dev/null
# HORIZON AT
if [ -e xml/horizon_at.xml ]
then
grep 'channel id=' xml/horizon_at.xml > /tmp/xmlch_at
sed -i 's/<channel id="/[HORIZON AT] /g;s/">//g;s/\&/\&/g' /tmp/xmlch_at
else
rm combine/$(sed -n "$(</tmp/selectedsetup)p" /tmp/combine)/hzn_at_channels.json 2> /dev/null
fi
touch combine/$(sed -n "$(</tmp/selectedsetup)p" /tmp/combine)/hzn_at_channels.json /tmp/xmlch_at
cd combine/$(sed -n "$(</tmp/selectedsetup)p" /tmp/combine)
if [ -e hzn_at_channels.json ]
then
sed '/{"channels":\[/d;/}/d;s/",//g;s/"\]//g;s/"//g' hzn_at_channels.json > /tmp/channels_at && cat /tmp/channels_at >> /tmp/xmlch2
sed -i 's/.*/[HORIZON AT] &/g' /tmp/channels_at
comm -12 <(sort -u /tmp/xmlch_at) <(sort -u /tmp/channels_at) > /tmp/comm_menu_enabled
comm -2 -3 <(sort -u /tmp/xmlch_at) <(sort -u /tmp/channels_at) > /tmp/comm_menu_disabled
sed 's/.*/"&" "" on \\/g' /tmp/comm_menu_enabled >> /tmp/chmenu
sed 's/.*/"&" "" off \\/g' /tmp/comm_menu_disabled >> /tmp/chmenu
fi
cd - > /dev/null
# HORIZON CH
if [ -e xml/horizon_ch.xml ]
then
grep 'channel id=' xml/horizon_ch.xml > /tmp/xmlch_ch
sed -i 's/<channel id="/[HORIZON CH] /g;s/">//g;s/\&/\&/g' /tmp/xmlch_ch
else
rm combine/$(sed -n "$(</tmp/selectedsetup)p" /tmp/combine)/hzn_ch_channels.json 2> /dev/null
fi
touch combine/$(sed -n "$(</tmp/selectedsetup)p" /tmp/combine)/hzn_ch_channels.json /tmp/xmlch_ch
cd combine/$(sed -n "$(</tmp/selectedsetup)p" /tmp/combine)
if [ -e hzn_ch_channels.json ]
then
sed '/{"channels":\[/d;/}/d;s/",//g;s/"\]//g;s/"//g' hzn_ch_channels.json > /tmp/channels_ch && cat /tmp/channels_ch >> /tmp/xmlch2
sed -i 's/.*/[HORIZON CH] &/g' /tmp/channels_ch
comm -12 <(sort -u /tmp/xmlch_ch) <(sort -u /tmp/channels_ch) > /tmp/comm_menu_enabled
comm -2 -3 <(sort -u /tmp/xmlch_ch) <(sort -u /tmp/channels_ch) > /tmp/comm_menu_disabled
sed 's/.*/"&" "" on \\/g' /tmp/comm_menu_enabled >> /tmp/chmenu
sed 's/.*/"&" "" off \\/g' /tmp/comm_menu_disabled >> /tmp/chmenu
fi
cd - > /dev/null
# HORIZON NL
if [ -e xml/horizon_nl.xml ]
then
grep 'channel id=' xml/horizon_nl.xml > /tmp/xmlch_nl
sed -i 's/<channel id="/[HORIZON NL] /g;s/">//g;s/\&/\&/g' /tmp/xmlch_nl
else
rm combine/$(sed -n "$(</tmp/selectedsetup)p" /tmp/combine)/hzn_nl_channels.json 2> /dev/null
fi
touch combine/$(sed -n "$(</tmp/selectedsetup)p" /tmp/combine)/hzn_nl_channels.json /tmp/xmlch_nl
cd combine/$(sed -n "$(</tmp/selectedsetup)p" /tmp/combine)
if [ -e hzn_nl_channels.json ]
then
sed '/{"channels":\[/d;/}/d;s/",//g;s/"\]//g;s/"//g' hzn_nl_channels.json > /tmp/channels_nl && cat /tmp/channels_nl >> /tmp/xmlch2
sed -i 's/.*/[HORIZON NL] &/g' /tmp/channels_nl
comm -12 <(sort -u /tmp/xmlch_nl) <(sort -u /tmp/channels_nl) > /tmp/comm_menu_enabled
comm -2 -3 <(sort -u /tmp/xmlch_nl) <(sort -u /tmp/channels_nl) > /tmp/comm_menu_disabled
sed 's/.*/"&" "" on \\/g' /tmp/comm_menu_enabled >> /tmp/chmenu
sed 's/.*/"&" "" off \\/g' /tmp/comm_menu_disabled >> /tmp/chmenu
fi
cd - > /dev/null
# HORIZON PL
if [ -e xml/horizon_pl.xml ]
then
grep 'channel id=' xml/horizon_pl.xml > /tmp/xmlch_pl
sed -i 's/<channel id="/[HORIZON PL] /g;s/">//g;s/\&/\&/g' /tmp/xmlch_pl
else
rm combine/$(sed -n "$(</tmp/selectedsetup)p" /tmp/combine)/hzn_pl_channels.json 2> /dev/null
fi
touch combine/$(sed -n "$(</tmp/selectedsetup)p" /tmp/combine)/hzn_pl_channels.json /tmp/xmlch_pl
cd combine/$(sed -n "$(</tmp/selectedsetup)p" /tmp/combine)
if [ -e hzn_pl_channels.json ]
then
sed '/{"channels":\[/d;/}/d;s/",//g;s/"\]//g;s/"//g' hzn_pl_channels.json > /tmp/channels_pl && cat /tmp/channels_pl >> /tmp/xmlch2
sed -i 's/.*/[HORIZON PL] &/g' /tmp/channels_pl
comm -12 <(sort -u /tmp/xmlch_pl) <(sort -u /tmp/channels_pl) > /tmp/comm_menu_enabled
comm -2 -3 <(sort -u /tmp/xmlch_pl) <(sort -u /tmp/channels_pl) > /tmp/comm_menu_disabled
sed 's/.*/"&" "" on \\/g' /tmp/comm_menu_enabled >> /tmp/chmenu
sed 's/.*/"&" "" off \\/g' /tmp/comm_menu_disabled >> /tmp/chmenu
fi
cd - > /dev/null
# HORIZON IE
if [ -e xml/horizon_ie.xml ]
then
grep 'channel id=' xml/horizon_ie.xml > /tmp/xmlch_ie
sed -i 's/<channel id="/[HORIZON IE] /g;s/">//g;s/\&/\&/g' /tmp/xmlch_ie
else
rm combine/$(sed -n "$(</tmp/selectedsetup)p" /tmp/combine)/hzn_ie_channels.json 2> /dev/null
fi
touch combine/$(sed -n "$(</tmp/selectedsetup)p" /tmp/combine)/hzn_ie_channels.json /tmp/xmlch_ie
cd combine/$(sed -n "$(</tmp/selectedsetup)p" /tmp/combine)
if [ -e hzn_ie_channels.json ]
then
sed '/{"channels":\[/d;/}/d;s/",//g;s/"\]//g;s/"//g' hzn_ie_channels.json > /tmp/channels_ie && cat /tmp/channels_ie >> /tmp/xmlch2
sed -i 's/.*/[HORIZON IE] &/g' /tmp/channels_ie
comm -12 <(sort -u /tmp/xmlch_ie) <(sort -u /tmp/channels_ie) > /tmp/comm_menu_enabled
comm -2 -3 <(sort -u /tmp/xmlch_ie) <(sort -u /tmp/channels_ie) > /tmp/comm_menu_disabled
sed 's/.*/"&" "" on \\/g' /tmp/comm_menu_enabled >> /tmp/chmenu
sed 's/.*/"&" "" off \\/g' /tmp/comm_menu_disabled >> /tmp/chmenu
fi
cd - > /dev/null
# HORIZON SK
if [ -e xml/horizon_sk.xml ]
then
grep 'channel id=' xml/horizon_sk.xml > /tmp/xmlch_sk
sed -i 's/<channel id="/[HORIZON SK] /g;s/">//g;s/\&/\&/g' /tmp/xmlch_sk
else
rm combine/$(sed -n "$(</tmp/selectedsetup)p" /tmp/combine)/hzn_sk_channels.json 2> /dev/null
fi
touch combine/$(sed -n "$(</tmp/selectedsetup)p" /tmp/combine)/hzn_sk_channels.json /tmp/xmlch_sk
cd combine/$(sed -n "$(</tmp/selectedsetup)p" /tmp/combine)
if [ -e hzn_sk_channels.json ]
then
sed '/{"channels":\[/d;/}/d;s/",//g;s/"\]//g;s/"//g' hzn_sk_channels.json > /tmp/channels_sk && cat /tmp/channels_sk >> /tmp/xmlch2
sed -i 's/.*/[HORIZON SK] &/g' /tmp/channels_sk
comm -12 <(sort -u /tmp/xmlch_sk) <(sort -u /tmp/channels_sk) > /tmp/comm_menu_enabled
comm -2 -3 <(sort -u /tmp/xmlch_sk) <(sort -u /tmp/channels_sk) > /tmp/comm_menu_disabled
sed 's/.*/"&" "" on \\/g' /tmp/comm_menu_enabled >> /tmp/chmenu
sed 's/.*/"&" "" off \\/g' /tmp/comm_menu_disabled >> /tmp/chmenu
fi
cd - > /dev/null
# HORIZON CZ
if [ -e xml/horizon_cz.xml ]
then
grep 'channel id=' xml/horizon_cz.xml > /tmp/xmlch_cz
sed -i 's/<channel id="/[HORIZON CZ] /g;s/">//g;s/\&/\&/g' /tmp/xmlch_cz
else
rm combine/$(sed -n "$(</tmp/selectedsetup)p" /tmp/combine)/hzn_cz_channels.json 2> /dev/null
fi
touch combine/$(sed -n "$(</tmp/selectedsetup)p" /tmp/combine)/hzn_cz_channels.json /tmp/xmlch_cz
cd combine/$(sed -n "$(</tmp/selectedsetup)p" /tmp/combine)
if [ -e hzn_cz_channels.json ]
then
sed '/{"channels":\[/d;/}/d;s/",//g;s/"\]//g;s/"//g' hzn_cz_channels.json > /tmp/channels_cz && cat /tmp/channels_cz >> /tmp/xmlch2
sed -i 's/.*/[HORIZON CZ] &/g' /tmp/channels_cz
comm -12 <(sort -u /tmp/xmlch_cz) <(sort -u /tmp/channels_cz) > /tmp/comm_menu_enabled
comm -2 -3 <(sort -u /tmp/xmlch_cz) <(sort -u /tmp/channels_cz) > /tmp/comm_menu_disabled
sed 's/.*/"&" "" on \\/g' /tmp/comm_menu_enabled >> /tmp/chmenu
sed 's/.*/"&" "" off \\/g' /tmp/comm_menu_disabled >> /tmp/chmenu
fi
cd - > /dev/null
# HORIZON HU
if [ -e xml/horizon_hu.xml ]
then
grep 'channel id=' xml/horizon_hu.xml > /tmp/xmlch_hu
sed -i 's/<channel id="/[HORIZON HU] /g;s/">//g;s/\&/\&/g' /tmp/xmlch_hu
else
rm combine/$(sed -n "$(</tmp/selectedsetup)p" /tmp/combine)/hzn_hu_channels.json 2> /dev/null
fi
touch combine/$(sed -n "$(</tmp/selectedsetup)p" /tmp/combine)/hzn_hu_channels.json /tmp/xmlch_hu
cd combine/$(sed -n "$(</tmp/selectedsetup)p" /tmp/combine)
if [ -e hzn_hu_channels.json ]
then
sed '/{"channels":\[/d;/}/d;s/",//g;s/"\]//g;s/"//g' hzn_hu_channels.json > /tmp/channels_hu && cat /tmp/channels_hu >> /tmp/xmlch2
sed -i 's/.*/[HORIZON HU] &/g' /tmp/channels_hu
comm -12 <(sort -u /tmp/xmlch_hu) <(sort -u /tmp/channels_hu) > /tmp/comm_menu_enabled
comm -2 -3 <(sort -u /tmp/xmlch_hu) <(sort -u /tmp/channels_hu) > /tmp/comm_menu_disabled
sed 's/.*/"&" "" on \\/g' /tmp/comm_menu_enabled >> /tmp/chmenu
sed 's/.*/"&" "" off \\/g' /tmp/comm_menu_disabled >> /tmp/chmenu
fi
cd - > /dev/null
# HORIZON RO
if [ -e xml/horizon_ro.xml ]
then
grep 'channel id=' xml/horizon_ro.xml > /tmp/xmlch_ro
sed -i 's/<channel id="/[HORIZON RO] /g;s/">//g;s/\&/\&/g' /tmp/xmlch_ro
else
rm combine/$(sed -n "$(</tmp/selectedsetup)p" /tmp/combine)/hzn_ro_channels.json 2> /dev/null
fi
touch combine/$(sed -n "$(</tmp/selectedsetup)p" /tmp/combine)/hzn_ro_channels.json /tmp/xmlch_ro
cd combine/$(sed -n "$(</tmp/selectedsetup)p" /tmp/combine)
if [ -e hzn_ro_channels.json ]
then
sed '/{"channels":\[/d;/}/d;s/",//g;s/"\]//g;s/"//g' hzn_ro_channels.json > /tmp/channels_ro && cat /tmp/channels_ro >> /tmp/xmlch2
sed -i 's/.*/[HORIZON RO] &/g' /tmp/channels_ro
comm -12 <(sort -u /tmp/xmlch_ro) <(sort -u /tmp/channels_ro) > /tmp/comm_menu_enabled
comm -2 -3 <(sort -u /tmp/xmlch_ro) <(sort -u /tmp/channels_ro) > /tmp/comm_menu_disabled
sed 's/.*/"&" "" on \\/g' /tmp/comm_menu_enabled >> /tmp/chmenu
sed 's/.*/"&" "" off \\/g' /tmp/comm_menu_disabled >> /tmp/chmenu
fi
cd - > /dev/null
# ZATTOO DE
if [ -e xml/zattoo_de.xml ]
then
grep 'channel id=' xml/zattoo_de.xml > /tmp/xmlch_zde
sed -i 's/<channel id="/[ZATTOO DE] /g;s/">//g;s/\&/\&/g' /tmp/xmlch_zde
else
rm combine/$(sed -n "$(</tmp/selectedsetup)p" /tmp/combine)/ztt_de_channels.json 2> /dev/null
fi
touch combine/$(sed -n "$(</tmp/selectedsetup)p" /tmp/combine)/ztt_de_channels.json /tmp/xmlch_zde
cd combine/$(sed -n "$(</tmp/selectedsetup)p" /tmp/combine)
if [ -e ztt_de_channels.json ]
then
sed '/{"channels":\[/d;/}/d;s/",//g;s/"\]//g;s/"//g' ztt_de_channels.json > /tmp/channels_zde && cat /tmp/channels_zde >> /tmp/xmlch2
sed -i 's/.*/[ZATTOO DE] &/g' /tmp/channels_zde
comm -12 <(sort -u /tmp/xmlch_zde) <(sort -u /tmp/channels_zde) > /tmp/comm_menu_enabled
comm -2 -3 <(sort -u /tmp/xmlch_zde) <(sort -u /tmp/channels_zde) > /tmp/comm_menu_disabled
sed 's/.*/"&" "" on \\/g' /tmp/comm_menu_enabled >> /tmp/chmenu
sed 's/.*/"&" "" off \\/g' /tmp/comm_menu_disabled >> /tmp/chmenu
fi
cd - > /dev/null
# ZATTOO CH
if [ -e xml/zattoo_ch.xml ]
then
grep 'channel id=' xml/zattoo_ch.xml > /tmp/xmlch_zch
sed -i 's/<channel id="/[ZATTOO CH] /g;s/">//g;s/\&/\&/g' /tmp/xmlch_zch
else
rm combine/$(sed -n "$(</tmp/selectedsetup)p" /tmp/combine)/ztt_ch_channels.json 2> /dev/null
fi
touch combine/$(sed -n "$(</tmp/selectedsetup)p" /tmp/combine)/ztt_ch_channels.json /tmp/xmlch_zch
cd combine/$(sed -n "$(</tmp/selectedsetup)p" /tmp/combine)
if [ -e ztt_ch_channels.json ]
then
sed '/{"channels":\[/d;/}/d;s/",//g;s/"\]//g;s/"//g' ztt_ch_channels.json > /tmp/channels_zch && cat /tmp/channels_zch >> /tmp/xmlch2
sed -i 's/.*/[ZATTOO CH] &/g' /tmp/channels_zch
comm -12 <(sort -u /tmp/xmlch_zch) <(sort -u /tmp/channels_zch) > /tmp/comm_menu_enabled
comm -2 -3 <(sort -u /tmp/xmlch_zch) <(sort -u /tmp/channels_zch) > /tmp/comm_menu_disabled
sed 's/.*/"&" "" on \\/g' /tmp/comm_menu_enabled >> /tmp/chmenu
sed 's/.*/"&" "" off \\/g' /tmp/comm_menu_disabled >> /tmp/chmenu
fi
cd - > /dev/null
# SWISSCOM CH
if [ -e xml/swisscom_ch.xml ]
then
grep 'channel id=' xml/swisscom_ch.xml > /tmp/xmlch_swc
sed -i 's/<channel id="/[SWISSCOM CH] /g;s/">//g;s/\&/\&/g' /tmp/xmlch_swc
else
rm combine/$(sed -n "$(</tmp/selectedsetup)p" /tmp/combine)/swc_ch_channels.json 2> /dev/null
fi
touch combine/$(sed -n "$(</tmp/selectedsetup)p" /tmp/combine)/swc_ch_channels.json /tmp/xmlch_swc
cd combine/$(sed -n "$(</tmp/selectedsetup)p" /tmp/combine)
if [ -e swc_ch_channels.json ]
then
sed '/{"channels":\[/d;/}/d;s/",//g;s/"\]//g;s/"//g' swc_ch_channels.json > /tmp/channels_swc && cat /tmp/channels_swc >> /tmp/xmlch2
sed -i 's/.*/[SWISSCOM CH] &/g' /tmp/channels_swc
comm -12 <(sort -u /tmp/xmlch_swc) <(sort -u /tmp/channels_swc) > /tmp/comm_menu_enabled
comm -2 -3 <(sort -u /tmp/xmlch_swc) <(sort -u /tmp/channels_swc) > /tmp/comm_menu_disabled
sed 's/.*/"&" "" on \\/g' /tmp/comm_menu_enabled >> /tmp/chmenu
sed 's/.*/"&" "" off \\/g' /tmp/comm_menu_disabled >> /tmp/chmenu
fi
cd - > /dev/null
# TVPLAYER UK
if [ -e xml/tvplayer_uk.xml ]
then
grep 'channel id=' xml/tvplayer_uk.xml > /tmp/xmlch_tvp
sed -i 's/<channel id="/[TVPLAYER UK] /g;s/">//g;s/\&/\&/g' /tmp/xmlch_tvp
else
rm combine/$(sed -n "$(</tmp/selectedsetup)p" /tmp/combine)/tvp_uk_channels.json 2> /dev/null
fi
touch combine/$(sed -n "$(</tmp/selectedsetup)p" /tmp/combine)/tvp_uk_channels.json /tmp/xmlch_tvp
cd combine/$(sed -n "$(</tmp/selectedsetup)p" /tmp/combine)
if [ -e tvp_uk_channels.json ]
then
sed '/{"channels":\[/d;/}/d;s/",//g;s/"\]//g;s/"//g' tvp_uk_channels.json > /tmp/channels_tvp && cat /tmp/channels_tvp >> /tmp/xmlch2
sed -i 's/.*/[TVPLAYER UK] &/g' /tmp/channels_tvp
comm -12 <(sort -u /tmp/xmlch_tvp) <(sort -u /tmp/channels_tvp) > /tmp/comm_menu_enabled
comm -2 -3 <(sort -u /tmp/xmlch_tvp) <(sort -u /tmp/channels_tvp) > /tmp/comm_menu_disabled
sed 's/.*/"&" "" on \\/g' /tmp/comm_menu_enabled >> /tmp/chmenu
sed 's/.*/"&" "" off \\/g' /tmp/comm_menu_disabled >> /tmp/chmenu
fi
cd - > /dev/null
# MAGENTATV DE
if [ -e xml/magentatv_de.xml ]
then
grep 'channel id=' xml/magentatv_de.xml > /tmp/xmlch_tkmde
sed -i 's/<channel id="/[MAGENTATV DE] /g;s/">//g;s/\&/\&/g' /tmp/xmlch_tkmde
else
rm combine/$(sed -n "$(</tmp/selectedsetup)p" /tmp/combine)/tkm_de_channels.json 2> /dev/null
fi
touch combine/$(sed -n "$(</tmp/selectedsetup)p" /tmp/combine)/tkm_de_channels.json /tmp/xmlch_tkmde
cd combine/$(sed -n "$(</tmp/selectedsetup)p" /tmp/combine)
if [ -e tkm_de_channels.json ]
then
sed '/{"channels":\[/d;/}/d;s/",//g;s/"\]//g;s/"//g' tkm_de_channels.json > /tmp/channels_tkmde && cat /tmp/channels_tkmde >> /tmp/xmlch2
sed -i 's/.*/[MAGENTATV DE] &/g' /tmp/channels_tkmde
comm -12 <(sort -u /tmp/xmlch_tkmde) <(sort -u /tmp/channels_tkmde) > /tmp/comm_menu_enabled
comm -2 -3 <(sort -u /tmp/xmlch_tkmde) <(sort -u /tmp/channels_tkmde) > /tmp/comm_menu_disabled
sed 's/.*/"&" "" on \\/g' /tmp/comm_menu_enabled >> /tmp/chmenu
sed 's/.*/"&" "" off \\/g' /tmp/comm_menu_disabled >> /tmp/chmenu
fi
cd - > /dev/null
# RADIOTIMES UK
if [ -e xml/radiotimes_uk.xml ]
then
grep 'channel id=' xml/radiotimes_uk.xml > /tmp/xmlch_rdtuk
sed -i 's/<channel id="/[RADIOTIMES UK] /g;s/">//g;s/\&/\&/g' /tmp/xmlch_rdtuk
else
rm combine/$(sed -n "$(</tmp/selectedsetup)p" /tmp/combine)/rdt_uk_channels.json 2> /dev/null
fi
touch combine/$(sed -n "$(</tmp/selectedsetup)p" /tmp/combine)/rdt_uk_channels.json /tmp/xmlch_rdtuk
cd combine/$(sed -n "$(</tmp/selectedsetup)p" /tmp/combine)
if [ -e rdt_uk_channels.json ]
then
sed '/{"channels":\[/d;/}/d;s/",//g;s/"\]//g;s/"//g' rdt_uk_channels.json > /tmp/channels_rdtuk && cat /tmp/channels_rdtuk >> /tmp/xmlch2
sed -i 's/.*/[RADIOTIMES UK] &/g' /tmp/channels_rdtuk
comm -12 <(sort -u /tmp/xmlch_rdtuk) <(sort -u /tmp/channels_rdtuk) > /tmp/comm_menu_enabled
comm -2 -3 <(sort -u /tmp/xmlch_rdtuk) <(sort -u /tmp/channels_rdtuk) > /tmp/comm_menu_disabled
sed 's/.*/"&" "" on \\/g' /tmp/comm_menu_enabled >> /tmp/chmenu
sed 's/.*/"&" "" off \\/g' /tmp/comm_menu_disabled >> /tmp/chmenu
fi
cd - > /dev/null
# WAIPU.TV DE
if [ -e xml/waipu_de.xml ]
then
grep 'channel id=' xml/waipu_de.xml > /tmp/xmlch_wpude
sed -i 's/<channel id="/[WAIPU.TV DE] /g;s/">//g;s/\&/\&/g' /tmp/xmlch_wpude
else
rm combine/$(sed -n "$(</tmp/selectedsetup)p" /tmp/combine)/wpu_de_channels.json 2> /dev/null
fi
touch combine/$(sed -n "$(</tmp/selectedsetup)p" /tmp/combine)/wpu_de_channels.json /tmp/xmlch_wpude
cd combine/$(sed -n "$(</tmp/selectedsetup)p" /tmp/combine)
if [ -e wpu_de_channels.json ]
then
sed '/{"channels":\[/d;/}/d;s/",//g;s/"\]//g;s/"//g' wpu_de_channels.json > /tmp/channels_wpude && cat /tmp/channels_wpude >> /tmp/xmlch2
sed -i 's/.*/[WAIPU.TV DE] &/g' /tmp/channels_wpude
comm -12 <(sort -u /tmp/xmlch_wpude) <(sort -u /tmp/channels_wpude) > /tmp/comm_menu_enabled
comm -2 -3 <(sort -u /tmp/xmlch_wpude) <(sort -u /tmp/channels_wpude) > /tmp/comm_menu_disabled
sed 's/.*/"&" "" on \\/g' /tmp/comm_menu_enabled >> /tmp/chmenu
sed 's/.*/"&" "" off \\/g' /tmp/comm_menu_disabled >> /tmp/chmenu
fi
cd - > /dev/null
# TV-SPIELFILM DE
if [ -e xml/tv-spielfilm_de.xml ]
then
grep 'channel id=' xml/tv-spielfilm_de.xml > /tmp/xmlch_tvsde
sed -i 's/<channel id="/[TV-SPIELFILM DE] /g;s/">//g;s/\&/\&/g' /tmp/xmlch_tvsde
else
rm combine/$(sed -n "$(</tmp/selectedsetup)p" /tmp/combine)/tvs_de_channels.json 2> /dev/null
fi
touch combine/$(sed -n "$(</tmp/selectedsetup)p" /tmp/combine)/tvs_de_channels.json /tmp/xmlch_tvsde
cd combine/$(sed -n "$(</tmp/selectedsetup)p" /tmp/combine)
if [ -e tvs_de_channels.json ]
then
sed '/{"channels":\[/d;/}/d;s/",//g;s/"\]//g;s/"//g' tvs_de_channels.json > /tmp/channels_tvsde && cat /tmp/channels_tvsde >> /tmp/xmlch2
sed -i 's/.*/[TV-SPIELFILM DE] &/g' /tmp/channels_tvsde
comm -12 <(sort -u /tmp/xmlch_tvsde) <(sort -u /tmp/channels_tvsde) > /tmp/comm_menu_enabled
comm -2 -3 <(sort -u /tmp/xmlch_tvsde) <(sort -u /tmp/channels_tvsde) > /tmp/comm_menu_disabled
sed 's/.*/"&" "" on \\/g' /tmp/comm_menu_enabled >> /tmp/chmenu
sed 's/.*/"&" "" off \\/g' /tmp/comm_menu_disabled >> /tmp/chmenu
fi
cd - > /dev/null
# VODAFONE DE
if [ -e xml/vodafone_de.xml ]
then