Script to install pantahub pvr from source using docker tag (default: latest), the script build the CLI from the source for the current platform and install it on ~/bin/pvr.
curl -o- -L https://git.io/fjEI1 | bash| #!/bin/bash | |
| set -e | |
| if [ -z "$1" ]; then | |
| TAG=latest | |
| else | |
| TAG=$1 | |
| fi | |
| case $(uname -m | sed 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/') in | |
| *64) | |
| ARCH=amd64 | |
| ;; | |
| *386*) | |
| ARCH=386 | |
| ;; | |
| arm*) | |
| ARCH=armv6 | |
| ;; | |
| *) | |
| echo "Architecture not supported. only supported amd64, 386 and arm" | |
| exit 0 | |
| ;; | |
| esac | |
| case $(uname | sed 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/') in | |
| linux*) | |
| OS=linux | |
| ;; | |
| darwin*) | |
| OS=darwin | |
| ;; | |
| msys*) | |
| OS=windows | |
| ;; | |
| *) | |
| echo "OS not supported" | |
| exit 0 | |
| ;; | |
| esac | |
| PLATFORM=($OS"_"$ARCH) | |
| mkdir /tmp/pvr | |
| cd /tmp/pvr | |
| echo "Building PVR for $PLATFORM using docker pvr image (tag: $TAG) ..." | |
| docker pull registry.gitlab.com/pantacor/pvr:$TAG | |
| docker run --rm registry.gitlab.com/pantacor/pvr:$TAG | tar x | |
| echo "Copying to ~/bin/pvr" | |
| cp ./bin/$PLATFORM/pvr ~/bin/pvr | |
| echo "Removing temporals" | |
| cd /tmp | |
| rm -rf pvr | |
| echo "Ready." | |
| echo "now you can go an run pvr" | |
| echo "pvr help" |