diff options
author | Nachtfalke <nachtfalkeaw@web.de> | 2011-12-20 21:26:50 +0100 |
---|---|---|
committer | Nachtfalke <nachtfalkeaw@web.de> | 2011-12-20 21:26:50 +0100 |
commit | 99f90358909b9d89a183ba50ea7dbb98d2658ff4 (patch) | |
tree | 60966bed0a9b5ab777e3901e4c3ce4345d018a92 /config | |
parent | ae6dd0edbd3d9e6ce2ec07aea54aeec73672d76a (diff) | |
download | pfsense-packages-99f90358909b9d89a183ba50ea7dbb98d2658ff4.tar.gz pfsense-packages-99f90358909b9d89a183ba50ea7dbb98d2658ff4.tar.bz2 pfsense-packages-99f90358909b9d89a183ba50ea7dbb98d2658ff4.zip |
only enable virtual-server "coa" if there is an interface-type "coa" which needs this server.
Diffstat (limited to 'config')
-rw-r--r-- | config/freeradius2/freeradius.inc | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/config/freeradius2/freeradius.inc b/config/freeradius2/freeradius.inc index 879077f4..ad113469 100644 --- a/config/freeradius2/freeradius.inc +++ b/config/freeradius2/freeradius.inc @@ -121,10 +121,10 @@ regular_expressions = $varsettingsregularexpressions extended_expressions = $varsettingsextendedexpressions EOD; -// This activates virtual-server coa. -// A better way would be if this link would only be created if there is an interface type "coa" -// and if deleted the link will be deleted, too -exec("ln -s /usr/local/etc/raddb/sites-available/coa /usr/local/etc/raddb/sites-enabled/"); + +// Deletes virtual-server coa by default. Will be re-enabled if there is an interface-type "coa" +exec("rm -f /usr/local/etc/raddb/sites-enabled/coa"); + $arrinterfaces = $config['installedpackages']['freeradiusinterfaces']['config']; if (is_array($arrinterfaces) && !empty($arrinterfaces)) { foreach ($arrinterfaces as $item) { @@ -149,6 +149,8 @@ EOD; // Begin "if" for interface-type = coa if ($item['varinterfacetype'] == 'coa') { + // Enables virtual-server coa because interface-type is coa + exec("ln -s /usr/local/etc/raddb/sites-available/coa /usr/local/etc/raddb/sites-enabled/"); $conf .= <<<EOD listen { type = $varinterfacetype @@ -158,7 +160,7 @@ listen { } EOD; - } // End "if" for interface-type = detail + } // End "if" for interface-type = coa // Begin "if" for interface-type = auth, acct, proxy, status if (($item['varinterfacetype'] == 'auth') || ($item['varinterfacetype'] == 'acct') || ($item['varinterfacetype'] == 'proxy') || ($item['varinterfacetype'] == 'status')) { @@ -257,7 +259,7 @@ global $config; $conf = ''; $users = $config['installedpackages']['freeradius']['config']; -if (is_array($users)) { +if (is_array($users) && !empty($users)) { foreach ($users as $user) { $username = $user['username']; $password = $user['password']; |