Comparison

mod_migrate/mod_migrate.lua @ 2139:17408ddd34b0

mod_migrate: Check that the hostname is known, or yell and abort (thanks Link Mauve)
author Kim Alvefur <zash@zash.se>
date Sun, 27 Mar 2016 20:09:29 +0200
parent 2064:2a82c55762a7
child 2812:fd4a5ba12fa2
comparison
equal deleted inserted replaced
2138:d3231a4d6a60 2139:17408ddd34b0
6 6
7 function module.command(arg) 7 function module.command(arg)
8 local host, source_stores, migrate_to, user = unpack(arg); 8 local host, source_stores, migrate_to, user = unpack(arg);
9 if not migrate_to then 9 if not migrate_to then
10 return print("Usage: prosodyctl mod_migrate example.com <source-store>[-<store-type>] <target-driver> [users]*"); 10 return print("Usage: prosodyctl mod_migrate example.com <source-store>[-<store-type>] <target-driver> [users]*");
11 end
12 if not prosody.hosts[host] then
13 return print(("The host %q is not know by Prosody."):format(host));
11 end 14 end
12 sm.initialize_host(host); 15 sm.initialize_host(host);
13 um.initialize_host(host); 16 um.initialize_host(host);
14 local module = module:context(host); 17 local module = module:context(host);
15 for source_store in source_stores:gmatch("[^,]+") do 18 for source_store in source_stores:gmatch("[^,]+") do