Last active
June 11, 2019 13:28
-
-
Save nevadajames/73b4b017f7b971383e3df81a579b596e to your computer and use it in GitHub Desktop.
install pv if absent
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| if [[ "$OSTYPE" == "darwin"* ]] ; then | |
| if ! brew ls --versions pv &> /dev/null ; then | |
| echo "Pipe Viewer is NOT installed!" | |
| brew install pv | |
| fi | |
| else | |
| distro=$(source /etc/os-release && echo "$NAME"); | |
| if [[ $distro == *"Debian"* ]] || [[ $distro == *"Ubuntu"* ]]; then | |
| if ! dpkg -l | grep -qw pv &> /dev/null ; then | |
| echo "Pipe Viewer is NOT installed!" | |
| apt-get update -y | |
| apt-get install -y pv | |
| fi | |
| elif [[ $distro == *"Manjaro"* ]]; then | |
| echo "what package manager?" | |
| else | |
| echo "Pipe View package must be installed for your system: $distro" | |
| exit 1 | |
| fi | |
| fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment