--fUYQa+Pmc3FrFX/N
Content-Type: text/plain; charset*=iso-8859-1''iso-8859-1
Content-Disposition: inline
On Mon, May 20, 2002 at 07:42:27AM -0500, Erich Zigler wrote:
> That sounds great. However the mailing list archive linked off of the mailing
> list itself and the website only goes back one month. Is there another
> mailing list archive site where I can find the August 8th pgsql patch and
I don't know anything about pgsql patch.
> this script your talking about?
OK. I'll attach script with these message. I think it shouldn't be
hard to adapt it to create Postgresql SQL statements (and other
databases, too).
Maybe the script can go to the doc directory because from time to time
people asks about it?. I can write short description how to use it, if
it is necessary.
Milan
--fUYQa+Pmc3FrFX/N
Content-Type: application/x-perl
Content-Disposition: attachment; filename*=iso-8859-1''dictimport%2Epl
#!/usr/bin/perl -T
########################################################################
# #
# dictimport.pl InnerCite #
# Mike Machado <[EMAIL PROTECTED]> #
# 27 April 1999 #
# #
# Imports standard RADIUS dictionaries into mysql #
# #
# Copyright under same terms as Cistron RADIUS #
# #
########################################################################
#
# Changed by Milan P. Stanic <[EMAIL PROTECTED]> not to use perl dbi
# interface
# script otputs to stdout MySQL statements which can be used to
# populate dictionary table for radius database
#
# Usage:
# dictimport.pl dictionary_file | mysql -uusername -ppassword radiusdb
# or:
# dictimport.pl dictionary_file > dictionary.sql
# and then:
# mysql -uusername -ppassword radiusdb < dictionary.sql
#
# Note: it is just quick hack
my $file = shift || '';
if ($file eq '') {
print "Usage: dictimport.pl dictionary\n";
exit;
}
open(DICT, $file) || die "Cannot open $file for read\n";
my ($dummystr, $namestr, $valstr, $typestr, $vendorstr);
my $sth;
my $sql = '';
my $lineno = 0;
while (<DICT>) {
$lineno++;
next if (/^#/);
next if (/^\$/);
next if (/^$/);
($dummystr, $namestr, $valstr, $typestr, $vendorstr) = split(/\s+/);
if ($dummystr =~ 'ATTRIB') {
$sql = "INSERT INTO dictionary VALUES
\(\"\",\"$dummystr\",\"$namestr\",\"$valstr\",\"$typestr\",\"$vendorstr\"\)\;";
} elsif ($dummystr eq 'VALUE') {
$sql = "INSERT INTO dictionary VALUES
\(\"\",\"$dummystr\",\"$namestr\",\"$valstr\",\"$typestr\",\"\"\)\;";
} elsif ($dummystr eq 'VENDOR') {
$sql = "INSERT INTO dictionary VALUES
\(\"\",\"$dummystr\",\"$namestr\",\"$valstr\",\"\",\"\"\)\;";
} else {
print "Unknown entry on line $lineno\n";
$sql = '';
}
print "$sql\n";
}
--fUYQa+Pmc3FrFX/N--
-
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html