Last Updated: September 09, 2019
·
496
· rrader

Determine whether we on Centos/RedHat or on SuSE linux

Determine whether we on Centos/RedHat or on SuSE linux

if which yum &>/dev/null; then
    # redhat-based
    echo redhat-based
elif which zypper &>/dev/null; then
    #SLES
    echo SLES
elif which rpm &>/dev/null; then
    echo something with RPM
else
    # something other
    echo other
fi