...
 
Commits (7)
......@@ -127,6 +127,9 @@ function checkservice($port) {
return $services;
}
/* MAIN PROGRAM STARTS */
$has_ispconfig = false;
......@@ -163,6 +166,32 @@ if($ip_address && count($ips) > 0 && in_array($ip_address, $ips, true) == false)
outlog("[WARN] ip addresses from hostname differ from ifconfig output. Please check your ip settings.");
}
// Check OS version
$lsbrel='/usr/bin/lsb_release';
$rhatrel = '/etc/redhat-release';
$osrelease='/etc/os-release';
$suserel = '/etc/SuSE-release';
$gentoorel = '/etc/gentoo-release';
if (file_exists($lsbrel)) {
$os_version = shell_exec($lsbrel.' -d -s');
} elseif (file_exists($rhatrel)) {
$os_version = shell_exec('cat '.$redhatrel);
} elseif (file_exists($suserel)) {
$os_version = shell_exec('cat '.$suserel);
} elseif (file_exists($gentoorel)) {
$os_version = shell_exec('cat '.$gentoorel);
} elseif (file_exists($osrelease)) {
$os_version = shell_exec('cat '.$osrelease.' | grep "PRETTY_NAME" | cut --characters=13-');
} else {
$lslisting = shell_exec('ls -lhd /etc/*versio* /etc/*releas* /etc/*issue*');
}
if ($os_version == '') {
outlog("ls listing to help show OS:\n".$lslisting);
} else {
outlog("[INFO] OS version is $os_version ");
}
// check for ISPConfig
if(@is_dir("/usr/local/ispconfig")) $has_ispconfig = true;
......