Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
ryananicholson committed May 18, 2020
1 parent 2ab7d0c commit 86aaa4d
Showing 1 changed file with 2 additions and 13 deletions.
15 changes: 2 additions & 13 deletions index.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,23 +12,12 @@ function command_exist($cmd) {
return !empty($return);
}

$OS = PHP_OS;

if ($OS == "Darwin") {
$OS_NAME = "macOS";
$OS_VER = exec("sw_vers -productVersion");
} elseif (command_exist("lsb_release")) {
$OS_NAME = exec("lsb_release -a 2>/dev/null | grep Distributor | awk '{print $3}'");
$OS_VER = exec("lsb_release -a 2>/dev/null | grep Release | awk '{print $2}'");
} elseif (command_exist("rpm")) {
$OS_NAME = exec("rpm --query redhat-release-server");
$OS_VER = "";
} elseif (command_exist("uname")) {
if (command_exist("uname")) {
$OS_NAME = exec("uname -r");
$OS_VER = "";
}

echo "Operating System: " . $OS_NAME . " " . $OS_VER . "<br/>";
echo "Kernel version: " . $OS_NAME . " " . $OS_VER . "<br/>";

if (command_exist("apache2")) {
$WEBPROG = exec("apache2 -V | grep ^Server\ version");
Expand Down

0 comments on commit 86aaa4d

Please sign in to comment.