projects
/
freeside.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
allow a full pathname to be specified to freeside-setup for initial configdir
[freeside.git]
/
FS
/
bin
/
freeside-setup
diff --git
a/FS/bin/freeside-setup
b/FS/bin/freeside-setup
index
188a186
..
cc6356c
100755
(executable)
--- a/
FS/bin/freeside-setup
+++ b/
FS/bin/freeside-setup
@@
-20,8
+20,8
@@
die "Not running uid freeside!" unless checkeuid();
# map { lc($FS::raddb::attrib{$_}) => $_ } keys %FS::raddb::attrib;
getopts("u:vd:");
# 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;
or die "unacceptable configuration directory name";
$config_dir = $1;
@@
-32,9
+32,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", <<END, ":";
#Freeside tracks the RADIUS User-Name, check attribute Password and
#print "\n\n", <<END, ":";
#Freeside tracks the RADIUS User-Name, check attribute Password and
@@
-81,7
+79,7
@@
my $username_len = 32; #usernamemax config file
# create a dbdef object from the old data structure
###
# create a dbdef object from the old data structure
###
-my $dbdef = dbdef_dist;
+my $dbdef = dbdef_dist
(datasrc)
;
#important
$dbdef->save($dbdef_file);
#important
$dbdef->save($dbdef_file);
@@
-100,7
+98,6
@@
$FS::UID::callback_hack = 0;
$|=1;
foreach my $statement ( $dbdef->sql($dbh) ) {
$|=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";
}
$dbh->do( $statement )
or die "CREATE error: ". $dbh->errstr. "\ndoing statement: $statement";
}
@@
-125,7
+122,7
@@
$FS::UID::callback_hack = 0;
if (!scalar(qsearch('conf', {}))) {
my $error = FS::Conf::init_config($config_dir);
if ($error) {
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;
}
}
die $error;
}
}