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