Merge branch 'ent-7461-11774-mejorar-obtencion-de-version-so-en-agentes-linux' into 'develop'

lsb-release to native /etc/*ease

See merge request artica/pandorafms!4775
This commit is contained in:
Daniel Rodriguez 2022-03-30 11:05:56 +00:00
commit 35a764fab7
3 changed files with 3 additions and 3 deletions

View File

@ -1141,7 +1141,7 @@ sub guess_os_version {
# Linux
if ($os eq 'linux') {
$os_version = `lsb_release -sd 2>$DevNull`;
$os_version = `cat /etc/*ease|grep PRETTY| cut -f 2 -d= | tr -d '"' 2>$DevNull`;
# AIX
} elsif ($os eq 'aix') {
$os_version = "$2.$1" if (`uname -rv` =~ /\s*(\d)\s+(\d)\s*/);

View File

@ -2736,7 +2736,7 @@ sub guess_os_version ($) {
# Linux
if ($os eq 'linux') {
$os_version = `lsb_release -sd 2>$DevNull`;
$os_version = `cat /etc/*ease|grep PRETTY| cut -f 2 -d= | tr -d '"' 2>$DevNull`;
# AIX
} elsif ($os eq 'aix') {
$os_version = "$2.$1" if (`uname -rv` =~ /\s*(\d)\s+(\d)\s*/);

View File

@ -237,7 +237,7 @@ our $OS = $^O;
our $OS_VERSION = "unknown";
our $DEVNULL = '/dev/null';
if ($OS eq 'linux') {
$OS_VERSION = `lsb_release -sd 2>/dev/null`;
$OS_VERSION = `cat /etc/*ease|grep PRETTY| cut -f 2 -d= | tr -d '"' 2>/dev/null`;
} elsif ($OS eq 'aix') {
$OS_VERSION = "$2.$1" if (`uname -rv` =~ /\s*(\d)\s+(\d)\s*/);
} elsif ($OS =~ /win/i) {