Skip to content

Commit

Permalink
Better Linux OS recognition
Browse files Browse the repository at this point in the history
Close #1303
  • Loading branch information
endelwar committed Aug 10, 2024
1 parent 4bbc9a4 commit fa70897
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions mailscanner/sf_version.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,12 +79,19 @@
$vars[$line[0]] = $line[1];
}
}

echo __('systemos11') . ' ';
$systemos = 'unknown linux';
if (isset($vars['ID']) && in_array(strtolower($vars['ID']), ['centos', 'debian'], true)) {
echo __('systemos11') . ' ' . $vars['PRETTY_NAME'] . '<br>' . "\n";
$systemos = $vars['PRETTY_NAME'];
}
else if (isset($vars['ID']) && 'ubuntu' === strtolower($vars['ID'])) {
$systemos = $vars['NAME'] . ' ' . $vars['VERSION'];
}
if (isset($vars['ID']) && 'ubuntu' === strtolower($vars['ID'])) {
echo __('systemos11') . ' ' . $vars['NAME'] . ' ' . $vars['VERSION'] . '<br>' . "\n";
else if (isset($vars['ID'])) {
$systemos = $vars['ID'];
}
echo $systemos . '<br>' . "\n";
}
if ('freebsd' === strtolower(PHP_OS)) {
echo __('systemos11') . ' ' . PHP_OS . ' ' . php_uname('r') . ' ' . php_uname('m') . '<br>' . "\n";
Expand Down

0 comments on commit fa70897

Please sign in to comment.