Comparison

util/prosodyctl.lua @ 10158:2cb48153f9e0

util.prosodyctl: Removed the admin_operation command
author João Duarte <jvsDuarte08@gmail.com>
date Wed, 24 Jul 2019 04:44:44 -0700
parent 10152:7e9c30eab11e
child 10167:f343ed1f02fd
comparison
equal deleted inserted replaced
10157:c6e166272d94 10158:2cb48153f9e0
284 local ok, pid = getpid() 284 local ok, pid = getpid()
285 if not ok then return false, pid; end 285 if not ok then return false, pid; end
286 286
287 signal.kill(pid, signal.SIGHUP); 287 signal.kill(pid, signal.SIGHUP);
288 return true; 288 return true;
289 end
290
291 local function admin_operation(operation, arg)
292 if arg[1] == "--help" then
293 print(" admin-"..operation)
294 print(" "..operation.."plugins from a server (repository)")
295 return 1;
296 end
297 local modules, tree, server, refresh = "", "", "", ""
298 for i, _ in ipairs(arg) do
299 if arg[i]:sub(1, #"--tree=") == "--tree=" then
300 tree = arg[i].." "
301 elseif arg[i]:sub(1, #"--server=") == "--server=" then
302 server = arg[i].." "
303 elseif arg[i]:sub(1, #"--no-refresh") == "--no-refresh" then
304 refresh = arg[i].." "
305 else
306 modules=modules..arg[i].." "
307 end
308 end
309 os.execute("luarocks-admin "..tree..operation..server..refresh..modules)
310 end 289 end
311 290
312 return { 291 return {
313 show_message = show_message; 292 show_message = show_message;
314 show_warning = show_message; 293 show_warning = show_message;
327 getpid = getpid; 306 getpid = getpid;
328 isrunning = isrunning; 307 isrunning = isrunning;
329 start = start; 308 start = start;
330 stop = stop; 309 stop = stop;
331 reload = reload; 310 reload = reload;
332 admin_operation = admin_operation;
333 }; 311 };