Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- # https://stackoverflow.com/questions/19477682/bash-script-determine-vendor-and-install-system-apt-get-yum-etc
- YUM_CMD=$(which yum)
- APT_GET_CMD=$(which apt-get)
- OTHER_CMD=$(which <other installer>)
- if [[ ! -z $YUM_CMD ]]; then
- yum install $YUM_PACKAGE_NAME
- elif [[ ! -z $APT_GET_CMD ]]; then
- apt-get $DEB_PACKAGE_NAME
- elif [[ ! -z $OTHER_CMD ]]; then
- $OTHER_CMD <proper arguments>
- else
- echo "error can't install package $PACKAGE"
- exit 1;
- fi
Advertisement
Add Comment
Please, Sign In to add comment