From: fredrik Date: Mon, 7 May 2007 10:56:02 +0000 (+0000) Subject: Add hup command. X-Git-Tag: 0.4~52 X-Git-Url: http://git.dolda2000.com/gitweb/?a=commitdiff_plain;h=c45c9b793539cdabca7f47563087579755ab74ac;p=doldaconnect.git Add hup command. git-svn-id: svn+ssh://svn.dolda2000.com/srv/svn/repos/src/doldaconnect@1018 959494ce-11ee-0310-bf91-de5d638817bd --- diff --git a/daemon/ui.c b/daemon/ui.c index bdff17b..795f7d7 100644 --- a/daemon/ui.c +++ b/daemon/ui.c @@ -1338,6 +1338,16 @@ static void cmd_uptime(struct socket *sk, struct uidata *data, int argc, wchar_t sq(sk, 0, L"200", L"%i", time(NULL) - starttime, NULL); } +static void cmd_hup(struct socket *sk, struct uidata *data, int argc, wchar_t **argv) +{ + extern volatile int reinit; + + havepriv(PERM_ADMIN); + flog(LOG_NOTICE, "UI HUP request from %ls", data->username); + reinit = 1; + sq(sk, 0, L"200", L"Will reinit", NULL); +} + #undef haveargs #undef havepriv @@ -1378,6 +1388,7 @@ static struct command commands[] = {L"register", cmd_register}, {L"sendmsg", cmd_sendmsg}, {L"uptime", cmd_uptime}, + {L"hup", cmd_hup}, {NULL, NULL} };