bootstrapping issues
[freeside.git] / bin / freeside-create-initial-data
1 #!/usr/bin/perl -Tw
2
3 #to allow initial insert
4 $FS::part_pkg::setup_hack = 1;
5 $FS::part_pkg::setup_hack = 1;
6
7 use strict;
8 use vars qw($opt_d $opt_v);
9 use Getopt::Std;
10 use FS::UID qw(adminsuidsetup);
11 use FS::Setup qw(create_initial_data);
12
13 getopts("d:");
14
15 my $dbh = adminsuidsetup shift;
16 create_initial_data('domain' => $opt_d);
17
18 warn "Freeside initial data inserted - commiting transaction\n" if $opt_v;
19
20 $dbh->commit or die $dbh->errstr;
21 $dbh->disconnect or die $dbh->errstr;
22
23 warn "Database initialization committed successfully\n" if $opt_v;
24
25 sub usage {
26   die "Usage:\n  freeside-create-initial-data -d domain.name [ -v ] user\n"
27 }
28
29 1;
30