Software /
code /
prosody
Comparison
plugins/mod_admin_adhoc.lua @ 5329:9fffd5fad4b3
mod_admin_adhoc: Fix 'Shut down service' command
author | Florian Zeitz <florob@babelmonkeys.de> |
---|---|
date | Thu, 07 Feb 2013 22:11:35 +0100 |
parent | 5328:5e15e6700412 |
child | 5371:706206e191e8 |
comparison
equal
deleted
inserted
replaced
5328:5e15e6700412 | 5329:9fffd5fad4b3 |
---|---|
669 local message = st.message({type = "headline"}, fields.announcement):up() | 669 local message = st.message({type = "headline"}, fields.announcement):up() |
670 :tag("subject"):text("Server is shutting down"); | 670 :tag("subject"):text("Server is shutting down"); |
671 send_to_online(message); | 671 send_to_online(message); |
672 end | 672 end |
673 | 673 |
674 timer_add_task(tonumber(fields.delay or "5"), prosody.shutdown); | 674 timer_add_task(tonumber(fields.delay or "5"), function(time) prosody.shutdown("Shutdown by adhoc command") end); |
675 | 675 |
676 return { status = "completed", info = "Server is about to shut down" }; | 676 return { status = "completed", info = "Server is about to shut down" }; |
677 else | 677 else |
678 return { status = "executing", actions = {"next", "complete", default = "complete"}, form = shut_down_service_layout }, "executing"; | 678 return { status = "executing", actions = {"next", "complete", default = "complete"}, form = shut_down_service_layout }, "executing"; |
679 end | 679 end |