X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=bin%2Fgenerate-raddb;h=1617dc10f1d188ba05f4c1782adcae6cfd96b56e;hp=c8843abcf224d14b8b5853aa8aaf02b9eb4d5af1;hb=b71b1576c68bc40ad26592b354feace37a029f0e;hpb=673b9a458d9138523026963df6fa3b4683e09bae diff --git a/bin/generate-raddb b/bin/generate-raddb index c8843abcf..1617dc10f 100755 --- a/bin/generate-raddb +++ b/bin/generate-raddb @@ -1,7 +1,7 @@ #!/usr/bin/perl # usage: generate-raddb radius-server/raddb/dictionary* >raddb.pm -# i.e.: generate-raddb ~/freeradius/freeradius-1.0.4/share/dictionary* /home/ivan/wirelessoceans/dictionary.ip3networks >raddb.pm.new +# i.e.: generate-raddb ~/freeradius/freeradius-1.0.5/share/dictionary* ~/wirelessoceans/dictionary.ip3networks ~/wtxs/dictionary.mot.canopy >raddb.pm.new print <) { - next if /^(#|\s*$|\$INCLUDE\s+)/; - next if /^(VALUE|VENDOR|BEGIN\-VENDOR|END\-VENDOR)\s+/; - /^(ATTRIBUTE|ATTRIB_NMC)\s+([\w\-\/]+)\s+/ or die $_; + next if /^\s*$/; + next if /^\s*(#|\$INCLUDE\s+)/; + next if /^(VALUE|VENDOR|BEGIN\-(VENDOR|TLV)|END\-(VENDOR|TLV))\s+/; + /^(ATTRIBUTE|ATTRIB_NMC)\s+([\w\-\/\.]+)\s+/ or die $_; $attrib = $2; $dbname = lc($2); $dbname =~ s/[\-\/]/_/g; @@ -28,17 +29,24 @@ while (<>) { #print "$2\n"; } -foreach ( keys %hash ) { +foreach ( sort keys %hash ) { # print "$_\n" if length($_)>24; # print substr($_,0,24),"\n" if length($_)>24; # $max = length($_) if length($_)>$max; # have to fudge things since everything >24 is *not* unique #print " '". substr($_,0,24). "' => '$hash{$_}',\n"; - print " '$_' => '$hash{$_}',\n"; + print " '$_' ". ( " " x (24-length($_) ) ). "=> '$hash{$_}',\n"; } print < 'Authentication-Type', + + #Canopy? (Kellin) + 'motorola_canopy_gateway' => 'Motorola-Canopy-Gateway', + ); 1;