Skip to content

Instantly share code, notes, and snippets.

@ssbarnea

ssbarnea/some.sh Secret

Created October 9, 2018 14:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ssbarnea/8324475f4599d36591bd149b44add716 to your computer and use it in GitHub Desktop.
Save ssbarnea/8324475f4599d36591bd149b44add716 to your computer and use it in GitHub Desktop.
python_cmd() {
basename $(command -v python3 || command -v python2)
}
package_manager() {
pkg = $(command -v yum || command -v dnf)
if [ "$(python_cmd)" == "python3" ]; then
echo -n "$pkg -y --exclude=python2*"
else
echo -n "$pkg -y --exclude=python3*"
fi
}
install_deps () {
# If sudo isn't installed assume we already are a super user
# install it anyways so that the install of the other deps succeeds
sudo true || $(package_manager) install sudo
sudo $(package_manager) install \
/usr/bin/git \
gcc \
iproute \
libyaml \
libselinux-python \
libffi-devel \
openssl-devel \
python*-virtualenv \
redhat-rpm-config
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment