diff options
author | Alexander Wilke <nachtfalkeaw@web.de> | 2012-06-20 22:09:24 +0300 |
---|---|---|
committer | Alexander Wilke <nachtfalkeaw@web.de> | 2012-06-20 22:09:24 +0300 |
commit | 70b6007a67c57a35ddc37177ba17007e14a8dd6a (patch) | |
tree | 586abe88a29b21389709286440e2d492be33c888 | |
parent | 39020bd5db974ed55b6ccdceb7cca492e235b17f (diff) | |
download | pfsense-packages-70b6007a67c57a35ddc37177ba17007e14a8dd6a.tar.gz pfsense-packages-70b6007a67c57a35ddc37177ba17007e14a8dd6a.tar.bz2 pfsense-packages-70b6007a67c57a35ddc37177ba17007e14a8dd6a.zip |
freeradius2: basics ready for 2.1
This is probably not the correct way for a package to run on pfsense 2.1 but at first it is working.
Probably some other fixes needed but it should be ok first to check if all the dependencies are there (MySQL, PostgreSQL, LDAP).
Any help on this package and fixes are really appreciated!
-rw-r--r-- | config/freeradius2/freeradius.inc | 29 |
1 files changed, 23 insertions, 6 deletions
diff --git a/config/freeradius2/freeradius.inc b/config/freeradius2/freeradius.inc index b2901e56..37e57aa8 100644 --- a/config/freeradius2/freeradius.inc +++ b/config/freeradius2/freeradius.inc @@ -45,7 +45,24 @@ require_once("globals.inc"); require_once("filter.inc"); require_once("services.inc"); -define('RADDB', '/usr/local/etc/raddb'); +// 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'); + define('USRLOCAL', '/usr/pbi/freeradius-i386'); + } + else { + define('RADDB', '/usr/pbi/freeradius-amd64/etc/raddb'); + define('USRLOCAL', '/usr/pbi/freeradius-amd64'); + } +} +else { + define('RADDB', '/usr/local/etc/raddb'); +} +// End of system check + + +// define('RADDB', '/usr/local/etc/raddb'); function freeradius_deinstall_command() { exec("cd /var/db/pkg && pkg_delete `ls | grep freeradius`"); @@ -64,7 +81,7 @@ function freeradius_install_command() { exec("mkdir " . RADDB . "/scripts"); if (!file_exists("/var/log/radutmp")) { exec("touch /var/log/radutmp"); } if (!file_exists("/var/log/radwtmp")) { exec("touch /var/log/radwtmp"); } - exec("chown -R root:wheel " . RADDB . " && chown -R root:wheel /usr/local/lib/freeradius-2.1.12 && chown -R root:wheel /var/log/radacct"); + exec("chown -R root:wheel " . RADDB . " && chown -R root:wheel " . USRLOCAL . "/lib/freeradius-2.1.12 && chown -R root:wheel /var/log/radacct"); // creating a backup file of the original policy.conf no matter if user checked this or not if (!file_exists(RADDB . "/policy.conf.backup")) { @@ -141,8 +158,8 @@ function freeradius_install_command() { $rcfile = array(); $rcfile['file'] = 'radiusd.sh'; - $rcfile['start'] = '/usr/local/etc/rc.d/radiusd onestart'; - $rcfile['stop'] = '/usr/local/etc/rc.d/radiusd onestop'; + $rcfile['start'] = USRLOCAL . '/etc/rc.d/radiusd onestart'; + $rcfile['stop'] = USRLOCAL . '/etc/rc.d/radiusd onestop'; write_rcfile($rcfile); conf_mount_ro(); start_service("radiusd"); @@ -220,7 +237,7 @@ function freeradius_settings_resync() { $conf .= <<<EOD -prefix = /usr/local +prefix = USRLOCAL exec_prefix = \${prefix} sysconfdir = \${prefix}/etc localstatedir = /var @@ -2602,7 +2619,7 @@ function freeradius_all_after_XMLRPC_resync() { log_error("FreeRADIUS: Finished XMLRPC process. It should be OK. For more information look at the host which started sync."); - exec("/usr/local/etc/rc.d/radiusd onerestart"); + exec(USRLOCAL . "/etc/rc.d/radiusd onerestart"); } function freeradius_modulescounter_resync() { |