sirgadget

Tvheadend tv_grab_file

Jul 8th, 2012
436
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.08 KB | None | 0 0
  1. #!/bin/bash
  2. dflag=
  3. vflag=
  4. cflag=
  5. if (( $# < 1 ))
  6. then
  7.   wget -qO- http://ontv.dk/xmltv/c81e728d9d4c2f636f067f89cc14862c
  8.   exit 0
  9. fi
  10.  
  11. for arg
  12. do
  13.     delim=""
  14.     case "$arg" in
  15.     #translate --gnu-long-options to -g (short options)
  16.        --description) args="${args}-d ";;
  17.        --version) args="${args}-v ";;
  18.        --capabilities) args="${args}-c ";;
  19.        #pass through anything else
  20.        *) [[ "${arg:0:1}" == "-" ]] || delim="\""
  21.            args="${args}${delim}${arg}${delim} ";;
  22.     esac
  23. done
  24.  
  25. #Reset the positional parameters to the short options
  26. eval set -- $args
  27.  
  28. while getopts "dvc" option
  29. do
  30.     case $option in
  31.         d)  dflag=1;;
  32.         v)  vflag=1;;
  33.         c)  cflag=1;;
  34.         \?) printf "unknown option: -%s\n" $OPTARG
  35.             printf "Usage: %s: [--description] [--version]
  36. [--capabilities] \n" $(basename $0)
  37.             exit 2
  38.             ;;
  39.     esac >&2
  40. done
  41.  
  42. if [ "$dflag" ]
  43. then
  44.    printf "tv_grab_file ONTV.dk"
  45. fi
  46. if [ "$vflag" ]
  47. then
  48.    printf "0.1\n"
  49. fi
  50. if [ "$cflag" ]
  51. then
  52.    printf "baseline\n"
  53. fi
  54.  
  55. exit 0
Advertisement
Add Comment
Please, Sign In to add comment