5959function get_distname () {
6060
6161 $ distname = '' ;
62+ $ distver = '' ;
63+ $ distid = '' ;
64+ $ distbaseid = '' ;
6265
6366 //** Debian or Ubuntu
6467 if (file_exists ('/etc/debian_version ' )) {
@@ -69,13 +72,18 @@ function get_distname() {
6972 $ distid = 'debian40 ' ;
7073 $ distbaseid = 'debian ' ;
7174 swriteln ("Operating System: Debian 4.0 or compatible \n" );
72- }
73- if (trim (file_get_contents ('/etc/debian_version ' )) == '5.0 ' || trim (file_get_contents ('/etc/debian_version ' )) == 'lenny/sid ' ) {
75+ } elseif (strstr (trim (file_get_contents ('/etc/debian_version ' )),'5.0 ' ) || trim (file_get_contents ('/etc/debian_version ' )) == 'lenny/sid ' ) {
7476 $ distname = 'Debian ' ;
7577 $ distver = 'Lenny/Sid ' ;
7678 $ distid = 'debian40 ' ;
7779 $ distbaseid = 'debian ' ;
7880 swriteln ("Operating System: Debian Lenny/Sid or compatible \n" );
81+ } else {
82+ $ distname = 'Debian ' ;
83+ $ distver = 'Unknown ' ;
84+ $ distid = 'debian40 ' ;
85+ $ distbaseid = 'debian ' ;
86+ swriteln ("Operating System: Debian or compatible, unknown version. \n" );
7987 }
8088 }
8189
@@ -87,13 +95,24 @@ function get_distname() {
8795 $ distid = 'opensuse110 ' ;
8896 $ distbaseid = 'opensuse ' ;
8997 swriteln ("Operating System: openSUSE 11.0 or compatible \n" );
90- }
91- if (stristr (file_get_contents ('/etc/SuSE-release ' ),'11.1 ' )) {
98+ } elseif (stristr (file_get_contents ('/etc/SuSE-release ' ),'11.1 ' )) {
9299 $ distname = 'openSUSE ' ;
93100 $ distver = '11.1 ' ;
94101 $ distid = 'opensuse110 ' ;
95102 $ distbaseid = 'opensuse ' ;
96103 swriteln ("Operating System: openSUSE 11.1 or compatible \n" );
104+ } elseif (stristr (file_get_contents ('/etc/SuSE-release ' ),'11.2 ' )) {
105+ $ distname = 'openSUSE ' ;
106+ $ distver = '11.1 ' ;
107+ $ distid = 'opensuse110 ' ;
108+ $ distbaseid = 'opensuse ' ;
109+ swriteln ("Operating System: openSUSE 11.2 or compatible \n" );
110+ } else {
111+ $ distname = 'openSUSE ' ;
112+ $ distver = 'Unknown ' ;
113+ $ distid = 'opensuse110 ' ;
114+ $ distbaseid = 'opensuse ' ;
115+ swriteln ("Operating System: openSUSE or compatible, unknown version. \n" );
97116 }
98117 }
99118
@@ -109,22 +128,30 @@ function get_distname() {
109128 $ distid = 'fedora9 ' ;
110129 $ distbaseid = 'fedora ' ;
111130 swriteln ("Operating System: Fedora 9 or compatible \n" );
112- }
113-
114- if (stristr ($ content ,'Fedora release 10 (Cambridge) ' )) {
131+ } elseif (stristr ($ content ,'Fedora release 10 (Cambridge) ' )) {
115132 $ distname = 'Fedora ' ;
116133 $ distver = '10 ' ;
117134 $ distid = 'fedora9 ' ;
118135 $ distbaseid = 'fedora ' ;
119136 swriteln ("Operating System: Fedora 10 or compatible \n" );
120- }
121-
122- if (stristr ($ content ,'CentOS release 5.2 (Final) ' )) {
137+ } elseif (stristr ($ content ,'CentOS release 5.2 (Final) ' )) {
123138 $ distname = 'CentOS ' ;
124139 $ distver = '5.2 ' ;
125140 $ distid = 'centos52 ' ;
126141 $ distbaseid = 'fedora ' ;
127142 swriteln ("Operating System: CentOS 5.2 or compatible \n" );
143+ } elseif (stristr ($ content ,'CentOS release 5.3 (Final) ' )) {
144+ $ distname = 'CentOS ' ;
145+ $ distver = '5.3 ' ;
146+ $ distid = 'centos52 ' ;
147+ $ distbaseid = 'fedora ' ;
148+ swriteln ("Operating System: CentOS 5.3 or compatible \n" );
149+ } else {
150+ $ distname = 'Redhat ' ;
151+ $ distver = 'Unknown ' ;
152+ $ distid = 'fedora9 ' ;
153+ $ distbaseid = 'fedora ' ;
154+ swriteln ("Operating System: Redhat or compatible, unknown version. \n" );
128155 }
129156
130157
0 commit comments