summaryrefslogtreecommitdiff
path: root/bin/freeside-create-initial-data
blob: 410208978c23e7e248756f379c289e5fbfbabf28 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/usr/bin/perl -Tw

#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_d $opt_v);
use Getopt::Std;
use FS::UID qw(adminsuidsetup);
use FS::Setup qw(create_initial_data);

getopts("d:");

my $dbh = adminsuidsetup shift;
create_initial_data('domain' => $opt_d);

warn "Freeside initial data inserted - commiting transaction\n" if $opt_v;

$dbh->commit or die $dbh->errstr;
$dbh->disconnect or die $dbh->errstr;

warn "Database initialization committed successfully\n" if $opt_v;

sub usage {
  die "Usage:\n  freeside-create-initial-data -d domain.name [ -v ] user\n"
}

1;