1 |
Index: e-smith-radiusd/e-smith-radiusd.spec |
2 |
diff -u /dev/null e-smith-radiusd/root/etc/e-smith/templates/etc/raddb/clients.conf/20local:1.1 |
3 |
--- /dev/null Fri Jun 24 15:02:36 2005 |
4 |
+++ e-smith-radiusd/root/etc/e-smith/templates/etc/raddb/clients.conf/20local Fri Jun 24 15:02:13 2005 |
5 |
@@ -0,0 +1,24 @@ |
6 |
+{ |
7 |
+ use esmith::HostsDB; |
8 |
+ my $hostsdb = esmith::HostsDB->open; |
9 |
+ |
10 |
+ # Handle each defined virtual domain |
11 |
+ foreach my $host ($hostsdb->get_all_by_prop(HostType => "Local")) |
12 |
+ { |
13 |
+ $radiuskey = $host->prop('RadiusKey') || undef; |
14 |
+ next unless defined $radiuskey; |
15 |
+ |
16 |
+ $hostname = $host->key; |
17 |
+ $hostname =~ s/\..*//; |
18 |
+ $hostip = $host->prop('InternalIP') || '127.0.0.1'; |
19 |
+ $nastype = $host->prop('NASType') || 'other'; |
20 |
+ |
21 |
+ $OUT .= <<EOF; |
22 |
+client $hostip \{ |
23 |
+ secret = $radiuskey |
24 |
+ shortname = $hostname |
25 |
+ nastype = $nastype |
26 |
+\} |
27 |
+EOF |
28 |
+ } |
29 |
+} |