Project

General

Profile

Synology TVHeadend-Testing release XMLTV and freepg EPG f... ยป tv_grab_file example.txt

John Jones, 2019-09-26 14:23

 
1
#!/bin/bash
2
dflag=
3
vflag=
4
cflag=
5
if (( $# < 1 ))
6
then
7
 XMLTV=/tmp
8
 XMLFILE=$XMLTV/tv_grab_file.xmltv
9
 wget -O $XMLFILE.gz 'http://au.freepg.tv/xmltv/oztivo/NSW.Sydney.gz?UID=<myUID>&K=<myKEY>
10
 gunzip -f $XMLFILE.gz
11
 cat $XMLFILE 
12
exit 0
13
fi
14

    
15
for arg
16
do
17
    delim=""
18
    case "$arg" in
19
    #translate --gnu-long-options to -g (short options)
20
       --description) args="${args}-d ";;
21
       --version) args="${args}-v ";;
22
       --capabilities) args="${args}-c ";;
23
       #pass through anything else
24
       *) [[ "${arg:0:1}" == "-" ]] || delim="\""
25
           args="${args}${delim}${arg}${delim} ";;
26
    esac
27
done
28

    
29
#Reset the positional parameters to the short options
30
eval set -- $args
31

    
32
while getopts "dvc" option 
33
do
34
    case $option in
35
        d)  dflag=1;;
36
        v)  vflag=1;;
37
        c)  cflag=1;;
38
        \?) printf "unknown option: -%s\n" $OPTARG
39
            printf "Usage: %s: [--description] [--version] [--capabilities] \n" $(basename $0)
40
            exit 2
41
            ;;
42
    esac >&2
43
done
44

    
45
if [ "$dflag" ]
46
then
47
   printf "tv_grab_file is a simple grabber that just read the ~/var/epggrab/tv_grab_file.xmltv file\n"
48
fi
49
if [ "$vflag" ]
50
then
51
   printf "0.1\n"
52
fi
53
if [ "$cflag" ]
54
then
55
   printf "baseline\n"
56
fi
57

    
58
exit 0
    (1-1/1)