smeserver-phplist/root/etc/e-smith/events/actions/phplist-create-pseudo

21 lines
453 B
Perl

#!/usr/bin/perl -w
use strict;
use warnings;
use esmith::AccountsDB;
my $a = esmith::AccountsDB->open or die "Couldn't open AccountsDB\n";
my $pseudo = $a->get('listreports');
if (!$pseudo){
$a->new_record('listreports',{
type => 'pseudonym',
Account => 'admin'
});
unless ( system("/sbin/e-smith/signal-event", "pseudonym-create", "listreports") == 0 ){
die "Failed to create pseudonym listreports\n";
}
}