Advertisement
Sk1rm1sh

/usr/bin/tv_grab_melbourne

Mar 12th, 2025
228
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.66 KB | None | 0 0
  1. #!/bin/sh
  2.  
  3. URL="https://i.mjh.nz/au/Melbourne/epg.xml.gz"
  4. DESCRIPTION="tv_grab (MattHuisman.nz)"
  5. VERSION="1.3"
  6.  
  7. if [ $# -lt 1 ]; then
  8.     >&2 echo "Downloading $URL..."
  9.     (
  10.       curl -sL "$URL" || wget -qO - "$URL" || >&2 echo "ERROR: Failed to fetch data"
  11.     ) | gunzip
  12.     exit 0
  13. fi
  14.  
  15. dflag=
  16. vflag=
  17. cflag=
  18.  
  19. for a in "$@"; do
  20.   [ "$a" = "-d" -o "$a" = "--description"  ] && dflag=1
  21.   [ "$a" = "-v" -o "$a" = "--version"      ] && vflag=1
  22.   [ "$a" = "-c" -o "$a" = "--capabilities" ] && cflag=1
  23. done
  24.  
  25. if [ -n "$dflag" ]; then
  26.   echo $DESCRIPTION
  27. fi
  28.  
  29. if [ -n "$vflag" ]; then
  30.   echo $VERSION
  31. fi
  32.  
  33. if [ -n "$cflag" ]; then
  34.   echo "baseline"
  35. fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement