From: Wilfried Göesgens Date: Mon, 30 Jul 2007 23:17:39 +0000 (+0000) Subject: * scdn now allso knows how to trigger restart. X-Git-Tag: v7.86~3196 X-Git-Url: https://code.citadel.org/?a=commitdiff_plain;h=8e8f30491de30cb34c8743db23296bdf15bd2b32;p=citadel.git * scdn now allso knows how to trigger restart. --- diff --git a/citadel/citserver.c b/citadel/citserver.c index 825d756e5..a89ef729b 100644 --- a/citadel/citserver.c +++ b/citadel/citserver.c @@ -793,14 +793,29 @@ void cmd_halt(void) { void cmd_scdn(char *argbuf) { int new_state; + int state = CIT_OK; + char *Reply = "%d %d\n"; if (CtdlAccessCheck(ac_aide)) return; new_state = extract_int(argbuf, 0); + if (new_state > 1) + { + restart_server = 1; + if (!running_as_daemon) + { + lprintf(CTDL_ERR, "The user requested restart, but not running as deamon! Geronimooooooo!\n"); + Reply = "%d %d Warning, not running in deamon mode. maybe we will come up again, but don't lean on it.\n"; + state = ERROR; + } + + restart_server = extract_int(argbuf, 0); + new_state -= 2; + } if ((new_state == 0) || (new_state == 1)) { ScheduledShutdown = new_state; } - cprintf("%d %d\n", CIT_OK, ScheduledShutdown); + cprintf(Reply, state, ScheduledShutdown); }