summaryrefslogtreecommitdiff
path: root/bin/freeside-create-initial-data
blob: 052f474653a50aa45b42bfb5b8e48d8c9f76e466 (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
#!/usr/bin/perl -Tw

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;