File tree Expand file tree Collapse file tree 1 file changed +22
-2
lines changed
Expand file tree Collapse file tree 1 file changed +22
-2
lines changed Original file line number Diff line number Diff line change @@ -66,8 +66,28 @@ function get_distname() {
6666 $ distid = '' ;
6767 $ distbaseid = '' ;
6868
69- //** Debian or Ubuntu
70- if (file_exists ('/etc/debian_version ' )) {
69+ //** Debian or Ubuntu
70+ if (is_file ('/etc/os-release ' ) && stristr (file_get_contents ('/etc/os-release ' ), 'Ubuntu ' )) {
71+ $ os_release = file_get_contents ('/etc/os-release ' );
72+ if (strstr (trim ($ os_release ), 'LTS ' )) {
73+ $ lts = " LTS " ;
74+ } else {
75+ $ lts = "" ;
76+ }
77+
78+ preg_match ("/.*VERSION= \"(.*) \".*/ui " , $ os_release , $ ver );
79+ $ ver = str_replace ("LTS " , "" , $ ver [1 ]);
80+ $ ver = explode (" " , $ ver , 2 );
81+ $ relname = end ($ ver );
82+ $ relname = "( " . trim (trim ($ relname ), "() " ) . ") " ;
83+ $ distname = 'Ubuntu ' ;
84+ $ ver = reset ($ ver );
85+ $ distid = 'debian40 ' ;
86+ $ distbaseid = 'debian ' ;
87+ $ distver = $ ver . $ lts . " " . $ relname ;
88+ swriteln ("Operating System: " . $ distver . "\n" );
89+ } //** Debian / Ubuntu
90+ elseif (file_exists ('/etc/debian_version ' )) {
7191 if (strstr (trim (file_get_contents ('/etc/issue ' )), 'Ubuntu ' )) {
7292 if (strstr (trim (file_get_contents ('/etc/issue ' )), 'LTS ' )) {
7393 $ lts =" LTS " ;
You can’t perform that action at this time.
0 commit comments