You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
29 lines
789 B
29 lines
789 B
#!/usr/bin/perl -w
|
|
|
|
use strict;
|
|
use warnings;
|
|
use esmith::DomainsDB;
|
|
use esmith::ConfigDB;
|
|
|
|
my $d = esmith::DomainsDB->open or die "Couldn't open DomainsDB\n";
|
|
my $c = esmith::ConfigDB->open_ro() or die "Couldn't open ConfigDB\n";
|
|
|
|
my $domain = $c->get('DomainName')->value;
|
|
|
|
my $vhost = $d->get("sql.$domain");
|
|
|
|
exit(0) if ($vhost);
|
|
|
|
|
|
$d->new_record("sql.$domain",{
|
|
type => 'domain',
|
|
Description => 'phpMyAdmin',
|
|
Content => 'Primary',
|
|
TemplatePath => 'WebAppVirtualHost',
|
|
DocumentRoot => '/usr/share/phpMyAdmin',
|
|
Authentication => 'LemonLDAP',
|
|
RequireSSL => 'yes'
|
|
});
|
|
|
|
die "Failed to create domain sql.$domain\n"
|
|
unless ( system("/sbin/e-smith/signal-event", "domain-create" , "sql.$domain") == 0 );
|
|
|