#to delay loading dbdef until we're ready
BEGIN { $FS::Schema::setup_hack = 1; }
+#to allow initial insert
+use FS::part_pkg;
+$FS::part_pkg::setup_hack = 1;
+$FS::part_pkg::setup_hack = 1;
+
use strict;
use vars qw($opt_u $opt_d $opt_v);
use Getopt::Std;
# map { lc($FS::raddb::attrib{$_}) => $_ } keys %FS::raddb::attrib;
getopts("u:vd:");
-my $config_dir = shift || 'conf' ;
-$config_dir =~ /^([\w.:=]+)$/
+my $config_dir = shift || '%%%DIST_CONF%%%' ;
+$config_dir =~ /^([\w.:=\/]+)$/
or die "unacceptable configuration directory name";
$config_dir = $1;
###
-#print "\nEnter the maximum username length: ";
-#my($username_len)=&getvalue;
-my $username_len = 32; #usernamemax config file
+my $username_len = 32;
#print "\n\n", <<END, ":";
#Freeside tracks the RADIUS User-Name, check attribute Password and
# create a dbdef object from the old data structure
###
-my $dbdef = dbdef_dist;
+my $dbdef = dbdef_dist(datasrc);
#important
$dbdef->save($dbdef_file);
$|=1;
foreach my $statement ( $dbdef->sql($dbh) ) {
- warn $statement if $statement =~ /TABLE cdr/;
$dbh->do( $statement )
or die "CREATE error: ". $dbh->errstr. "\ndoing statement: $statement";
}