From f2d3fcde45029c4bc10748147ce6f92a99887e62 Mon Sep 17 00:00:00 2001 From: Alexander Wilke Date: Sun, 24 Jun 2012 21:07:07 +0300 Subject: some better code --- config/freeradius2/freeradius_view_config.php | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/config/freeradius2/freeradius_view_config.php b/config/freeradius2/freeradius_view_config.php index ee7ca4c1..e584a4ba 100644 --- a/config/freeradius2/freeradius_view_config.php +++ b/config/freeradius2/freeradius_view_config.php @@ -33,15 +33,9 @@ require("guiconfig.inc"); // Check to find out on which system the package is running -if (exec("uname -r | cut -c 1-3") == '8.3') { - if (exec("uname -m") == "i386") { - define('RADDB', '/usr/pbi/freeradius-i386/etc/raddb'); - } - else { - define('RADDB', '/usr/pbi/freeradius-amd64/etc/raddb'); - } -} -else { +if (substr(trim(file_get_contents("/etc/version")),0,3) == "2.1") { + define('RADDB', '/usr/pbi/freeradius-' . php_uname("m") . '/etc/raddb'); +} else { define('RADDB', '/usr/local/etc/raddb'); } // End of system check -- cgit v1.2.3