Add /cancelreboot

This commit is contained in:
luk3yx 2018-02-24 12:35:25 +13:00
parent b847d742d7
commit 38a1356d12
1 changed files with 16 additions and 0 deletions

View File

@ -40,8 +40,24 @@ minetest.register_chatcommand("reboot", {
params = "",
description = "Reboots the server next time it is empty.",
func = function()
if reboot then
return false, "There is already a reboot pending!"
end
reboot = true
checkReboot()
return true, "Reboot scheduled!"
end
})
minetest.register_chatcommand("cancelreboot", {
privs = {server = true},
params = "",
description = "Cancels a pending reboot.",
func = function()
if not reboot then
return false, "There is no reboot to cancel!"
end
reboot = false
return true, "Reboot aborted!"
end
})