File tree Expand file tree Collapse file tree 3 files changed +3
-3
lines changed
Expand file tree Collapse file tree 3 files changed +3
-3
lines changed Original file line number Diff line number Diff line change 6868 version = file ("/etc/redhat-release" ).readline ()
6969 if version .find ("Red Hat Enterprise Linux Server release 6" ) != - 1 :
7070 distro = RHEL6
71- elif version .find ("CentOS release " ) != - 1 :
71+ elif version .find ("CentOS" ) != - 1 :
7272 distro = CentOS
7373 else :
7474 distro = CentOS
Original file line number Diff line number Diff line change @@ -114,7 +114,7 @@ def __init__(self):
114114 self .distro = "RHEL6"
115115 elif version .find ("Red Hat Enterprise Linux Server release 7" ) != - 1 :
116116 self .distro = "RHEL7"
117- elif version .find ("CentOS release " ) != - 1 :
117+ elif version .find ("CentOS" ) != - 1 :
118118 self .distro = "CentOS"
119119 else :
120120 self .distro = "RHEL5"
Original file line number Diff line number Diff line change @@ -32,7 +32,7 @@ CODENAME=""
3232if [ -f /etc/redhat-release ] ; then
3333 DIST=` cat /etc/redhat-release | awk ' {print $1}' `
3434 CODENAME=` cat /etc/redhat-release | sed s/.* \( // | sed s/\) //`
35- REV=` cat /etc/redhat-release | awk ' {print $3} ' `
35+ REV=` cat /etc/redhat-release | awk ' {print $3,$4} ' | grep -o " [0-9.]* " `
3636elif [ -f /etc/lsb-release ] ; then
3737 DIST=` cat /etc/lsb-release | grep DISTRIB_ID | tr " \n" ' ' | sed s/.* =//`
3838 REV=` cat /etc/lsb-release | grep DISTRIB_RELEASE | tr " \n" ' ' | sed s/.* =//`
You can’t perform that action at this time.
0 commit comments