Skip to content

Commit

Permalink
Fix on retrieving OS name
Browse files Browse the repository at this point in the history
  • Loading branch information
shevabam committed Feb 11, 2015
1 parent 086a182 commit efbbfed
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions libs/system.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
$hostname = php_uname('n');

// OS
if (!($os = shell_exec('/usr/bin/lsb_release -ds')))
if (!($os = shell_exec('/usr/bin/lsb_release -ds | cut -d= -f2 | tr -d \'"\'')))
{
if(!($os = shell_exec('cat /etc/system-release')))
if(!($os = shell_exec('cat /etc/system-release | cut -d= -f2 | tr -d \'"\'')))
{
if (!($os = shell_exec('find /etc/*-release -type f -exec cat {} \; | grep NAME | tail -n 1 | cut -d= -f2 | tr -d \'"\'')))
{
Expand All @@ -16,6 +16,7 @@
}
}
$os = trim($os, '"');
$os = str_replace("\n", '', $os);

// Kernel
if (!($kernel = shell_exec('/bin/uname -r')))
Expand Down

0 comments on commit efbbfed

Please sign in to comment.