Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- #set -x
- xmltv_file_location=/tmp/guide.xml
- socket_location=/var/lib/tvheadend/epggrab/xmltv.sock
- # Download the xml file
- /usr/bin/tv_grab_melbourne > $xmltv_file_location
- # Remove one line
- sleep 2
- sed -i -e '/<!DOCTYPE tv SYSTEM "xmltv.dtd">/d' $xmltv_file_location
- dflag=
- vflag=
- cflag=
- if (( $# < 1 ))
- then
- cat "$xmltv_file_location"
- #cat "$xmltv_file_location" | /usr/bin/socat - UNIX-CONNECT:"$socket_location"
- exit 0
- fi
- for arg
- do
- delim=""
- case "$arg" in
- #translate --gnu-long-options to -g (short options)
- --description) args="${args}-d ";;
- --version) args="${args}-v ";;
- --capabilities) args="${args}-c ";;
- #pass through anything else
- *) [[ "${arg:0:1}" == "-" ]] || delim="\""
- args="${args}${delim}${arg}${delim} ";;
- esac
- done
- #Reset the positional parameters to the short options
- eval set -- $args
- while getopts "dvc" option
- do
- case $option in
- d) dflag=1;;
- v) vflag=1;;
- c) cflag=1;;
- \?) printf "unknown option: -%s\n" $OPTARG
- printf "Usage: %s: [--description] [--version] [--capabilities] \n" $(basename $0)
- exit 2
- ;;
- esac >&2
- done
- if [ "$dflag" ]
- then
- printf "$0 is a wrapper grabber around WebGrab+Plus\n"
- fi
- if [ "$vflag" ]
- then
- printf "0.1\n"
- fi
- if [ "$cflag" ]
- then
- printf "baseline\n"
- fi
- exit 0
- #set +x
Advertisement
Add Comment
Please, Sign In to add comment