From 8cdc57f0e9b77fe21634eb7e32c3934cd036730d Mon Sep 17 00:00:00 2001 From: Jesusaves Date: Thu, 6 May 2021 20:16:57 -0300 Subject: Add an auto-restart scheduler (external bash scripts) --- npc/commands/super-menu.txt | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'npc/commands') diff --git a/npc/commands/super-menu.txt b/npc/commands/super-menu.txt index faddd70d6..bf3923c92 100644 --- a/npc/commands/super-menu.txt +++ b/npc/commands/super-menu.txt @@ -210,6 +210,20 @@ OnWed0300: if (!$AUTORESTART || gettime(GETTIME_DAYOFMONTH) > 7) end; atcommand("@serverexit 101"); end; +} + +// Auto-restart scheduled +function script SchedRestart { + if (debug && $SCHED_RESTART) { + + if ($SCHED_RESTART == 1) + $SCHED_RESTART=gettimetick(2)+900; + if ($SCHED_RESTART > gettimetick(2)) + atcommand("@serverexit 101"); + + kamibroadcast("A restart has been scheduled to about %s.", FuzzyTime($SCHED_RESTART)); + } + return; } -- cgit v1.2.3-70-g09d2