Commit eac79568 authored by IKEDA Soji's avatar IKEDA Soji
Browse files

sympa.pl: Add an option "--open_list=list@domain" to restore closed list.

parent c33f7f04
......@@ -84,7 +84,7 @@ unless (
'health_check', 'send_digest',
'keep_digest', 'upgrade_config_location',
'role=s', 'dump_users',
'restore_users',
'restore_users', 'open_list=s',
)
) {
pod2usage(-exitval => 1, -output => \*STDERR);
......@@ -988,6 +988,27 @@ elsif ($main::options{'sync_list_db'}) {
keep_digest => $main::options{'keep_digest'},
)->spin;
exit 0;
} elsif ($main::options{'open_list'}) {
my ($listname, $robot_id) = split /\@/, $main::options{'open_list'}, 2;
my $current_list = Sympa::List->new($listname, $robot_id);
unless ($current_list) {
printf STDERR "Incorrect list name %s.\n",
$main::options{'open_list'};
exit 1;
}
my $spindle = Sympa::Spindle::ProcessRequest->new(
context => $robot_id,
action => 'open_list',
current_list => $current_list,
sender => Sympa::get_address($robot_id, 'listmaster'),
scenario_context => {skip => 1},
);
unless ($spindle and $spindle->spin and _report($spindle)) {
printf STDERR "Could not open list %s\n", $current_list->get_id;
exit 1;
}
exit 0;
}
die 'Unknown option';
......@@ -1157,6 +1178,7 @@ S<[ C<-l, --lang>=I<lang> ]> S<[ C<-m, --mail> ]>
S<[ C<-h, --help> ]> S<[ C<-v, --version> ]>
S<>
S<[ C<--import>=I<listname> ]>
S<[ C<--open_list>=I<list>[I<@robot>] ]>
S<[ C<--close_list>=I<list>[I<@robot>] ]>
S<[ C<--purge_list>=I<list>[I<@robot>] ]>
S<[ C<--lowercase> ]> S<[ C<--make_alias_file> ]>
......@@ -1310,6 +1332,11 @@ C<--input_file=>I</path/to/file.xml>
Modify the existing list installed under the robot robot_name and that
belongs to the family family_name. The new description is in the C<file.xml>.
=item C<--open_list=>I<list>[I<@robot>]
Restore the closed list (changing its status to open), add aliases and restore
users to DB (dump files in the list directory are imported).
=item C<--purge_list>=I<list>[@I<robot>]
Remove the list (remove archive, configuration files, users and owners in admin table. Restore is not possible after this operation.
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment