Skip to content

Instantly share code, notes, and snippets.

@alanhg
Last active October 6, 2022 06:58
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 alanhg/b861c85afa1887daa053ad90fa930453 to your computer and use it in GitHub Desktop.
Save alanhg/b861c85afa1887daa053ad90fa930453 to your computer and use it in GitHub Desktop.
install-package-certbot.sh
#!/bin/sh
# sudo sh -c "$(curl -fsSL https://gist.githubusercontent.com/alanhg/b861c85afa1887daa053ad90fa930453/raw/b9abe224631981fafd184de4b5b87d3fe12d3eaa/install-package-certbot.sh)"
YUM_CMD=$(which yum)
APT_GET_CMD=$(which apt-get)
APT_CMD=$(which apt)
PACKAGE=certbot
if [ ! -z $YUM_CMD ]; then
yum install -y $PACKAGE
elif [ ! -z $APT_GET_CMD ]; then
apt-get install -y $PACKAGE
elif [ ! -z $APT_CMD ]; then
apt install -y $PACKAGE
else
echo "error can't install package $PACKAGE"
exit 1;
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment