#获取系统发行版名称 if grep -Eqi "CentOS" /etc/issue || grep -Eq "CentOS" /etc/*-release; then release='CentOS' elif grep -Eqi "Debian" /etc/issue || grep -Eq "Debian" /etc/*-release; then release='Debian' elif grep -Eqi "Ubuntu" /etc/issue || grep -Eq "Ubuntu" /etc/*-release; then release='Ubuntu' else release='unknow' fi #获取系统版本号 if [[ -s /etc/redhat-release ]];then grep -oE "[0-9.]+" /etc/redhat-release else grep -oE "[0-9.]+" /etc/issue fi #获取系统位数 if [[ `getconf WORD_BIT` = '32' && `getconf LONG_BIT` = '64' ]] ; then bit='x64' else bit='x32' fi