X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2Fbin%2Ffreeside-setup;h=ddff81ef9ce69bec38fcf68b5f6de6f5a1c05285;hb=7b125e587a4d1ee0aca692e23ea7897f671855ae;hp=188a1867a2d41e34fef2d1fd61f173ebf99a722d;hpb=9509e5bfb7f9331303153cac24d7bfecbe2ea9f1;p=freeside.git diff --git a/FS/bin/freeside-setup b/FS/bin/freeside-setup index 188a1867a..ddff81ef9 100755 --- a/FS/bin/freeside-setup +++ b/FS/bin/freeside-setup @@ -3,6 +3,11 @@ #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; @@ -20,8 +25,8 @@ die "Not running uid freeside!" unless checkeuid(); # 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; @@ -32,9 +37,7 @@ my($dbdef_file) = "%%%FREESIDE_CONF%%%/dbdef.". datasrc; ### -#print "\nEnter the maximum username length: "; -#my($username_len)=&getvalue; -my $username_len = 32; #usernamemax config file +my $username_len = 32; #print "\n\n", <save($dbdef_file); @@ -100,7 +103,6 @@ $FS::UID::callback_hack = 0; $|=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"; } @@ -125,7 +127,7 @@ $FS::UID::callback_hack = 0; if (!scalar(qsearch('conf', {}))) { my $error = FS::Conf::init_config($config_dir); if ($error) { - dbh->rollback or die dbh->errstr; + $dbh->rollback or die $dbh->errstr; die $error; } }