+ if ok then
+ local i=1;
+ while true do
+ local ok, running = prosodyctl.isrunning();
+ if ok and not running then
+ break;
+ elseif i == 5 then
+ show_message("Still waiting...");
+ elseif i >= prosodyctl_timeout then
+ show_message("Prosody is still running. Please give it some time or check your log files for errors.");
+ return 2;
+ end
+ socket.sleep(0.5);
+ i = i + 1;
+ end
+ show_message("Stopped");
+ return 0;
+ end