Skip to content

Instantly share code, notes, and snippets.

@alanhe421
Last active July 16, 2022 08:41
Show Gist options
  • Save alanhe421/6a299b815f4dd3d242abc16b8be6b861 to your computer and use it in GitHub Desktop.
Save alanhe421/6a299b815f4dd3d242abc16b8be6b861 to your computer and use it in GitHub Desktop.
install-package-lrzsz.sh / shell
#!/bin/sh
# sudo sh -c "$(curl -fsSL https://gist.githubusercontent.com/alanhg/6a299b815f4dd3d242abc16b8be6b861/raw/dbe1497208f1d968ed8b67cad09c596e35c5be9c/install-package-lrzsz.sh)"
YUM_CMD=$(which yum)
APT_GET_CMD=$(which apt-get)
APT_CMD=$(which apt)
PACKAGE=lrzsz
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