mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-31 01:35:36 +02:00
Added default value (unknown) to $OS_VERSION to avoid undefined value when
OS type is not detected. And added $OS_VERSION support for FreeBSD. (Cherry picked from commit 2b5368e8b5822fb128341cab17eaac6a902961ca)
This commit is contained in:
parent
e1672afb53
commit
6b672deb68
@ -136,7 +136,7 @@ use constant FIRED_ALERT => 1;
|
|||||||
|
|
||||||
# Set OS, OS version and /dev/null
|
# Set OS, OS version and /dev/null
|
||||||
our $OS = $^O;
|
our $OS = $^O;
|
||||||
our $OS_VERSION;
|
our $OS_VERSION = "unknown";
|
||||||
our $DEVNULL = '/dev/null';
|
our $DEVNULL = '/dev/null';
|
||||||
if ($OS eq 'linux') {
|
if ($OS eq 'linux') {
|
||||||
$OS_VERSION = `lsb_release -sd 2>/dev/null`;
|
$OS_VERSION = `lsb_release -sd 2>/dev/null`;
|
||||||
@ -146,6 +146,8 @@ if ($OS eq 'linux') {
|
|||||||
$OS = "windows";
|
$OS = "windows";
|
||||||
$OS_VERSION = `ver`;
|
$OS_VERSION = `ver`;
|
||||||
$DEVNULL = '/Nul';
|
$DEVNULL = '/Nul';
|
||||||
|
} elsif ($OS eq 'freebsd') {
|
||||||
|
$OS_VERSION = `uname -r`;
|
||||||
}
|
}
|
||||||
chomp($OS_VERSION);
|
chomp($OS_VERSION);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user