No need to declare INADDR_NONE here, it's a unix domain socket.
[citadel.git] / ctdlsh / src / shutdown.c
1 /*
2  * (c) 2011 by Art Cancro and citadel.org
3  * This program is released under the terms of the GNU General Public License v3.
4  */
5
6 #include "ctdlsh.h"
7
8 int cmd_shutdown(int server_socket, char *cmdbuf) {
9         char buf[1024];
10
11         char *p1 = readline("Do you really want to shut down the Citadel server? ");
12
13         if (strncasecmp(p1, "y", 1)) {
14                 return(cmdret_ok);
15         }
16
17         sock_puts("DOWN");
18         sock_getln(server_socket, buf, sizeof buf);
19         if (buf[0] != '2') {
20                 fprintf(stderr, "%s\n", &buf[4]);
21                 return(cmdret_error);
22         }
23
24         fprintf(stderr, "%s\n", &buf[4]);
25         return(cmdret_ok);
26 }