X-Git-Url: https://code.citadel.org/?a=blobdiff_plain;ds=sidebyside;f=ctdlsh%2Fsrc%2Fmain.c;h=e37a3d1662c9aa2ab81dc52b187b18057cef3e65;hb=18484af967a978c7eaa5cfbb1a7a2b2b8e8de19c;hp=247f8e9f328bbbd338fdb9f376e79a0d7edfbb47;hpb=dce5e794124f46e2cde4d9e7d05a3b900e4338e8;p=citadel.git diff --git a/ctdlsh/src/main.c b/ctdlsh/src/main.c index 247f8e9f3..e37a3d166 100644 --- a/ctdlsh/src/main.c +++ b/ctdlsh/src/main.c @@ -1,5 +1,5 @@ /* - * (c) 2009 by Art Cancro and citadel.org + * (c) 2009-2011 by Art Cancro and citadel.org * This program is released under the terms of the GNU General Public License v3. */ @@ -12,7 +12,32 @@ #include #include "ctdlsh.h" -#define CTDLDIR "/root/ctdl/trunk/citadel" +#define CTDLDIR "/appl/citadel" + + + +int com_quit(char *cmdbuf) { + abort(); +} + + + + +/* + * Commands understood by ctdlsh + */ +typedef struct { + char *name; + rl_icpfunc_t *func; + char *doc; +} COMMAND; + +COMMAND commands[] = { + { "quit", com_quit, "Quit using ctdlsh" }, + { "exit", com_quit, "Quit using ctdlsh" }, + { NULL, NULL, NULL } +}; + int discover_ipgm_secret(char *dirname) { int fd; @@ -71,7 +96,8 @@ void do_main_loop(int server_socket) { printf("%s\n", server_reply); if ((server_reply[0] == '4') || (server_reply[0] == '8')) { - // FIXME + /* we might consider putting something here */ + sock_puts(server_socket, "000"); } if ((server_reply[0] == '1') || (server_reply[0] == '8')) { @@ -95,7 +121,7 @@ int main(int argc, char **argv) char *ctdldir = CTDLDIR; printf("\nCitadel administration shell v" PACKAGE_VERSION "\n"); - printf("(c) 2009 citadel.org GPLv3\n"); + printf("(c) 2009-2011 citadel.org GPLv3\n"); opterr = 0; while ((c = getopt (argc, argv, "h:")) != -1) { @@ -120,14 +146,12 @@ int main(int argc, char **argv) exit(1); } - printf("Attaching to server...\r"); - fflush(stdout); + printf("Trying %s...\n", ctdldir); sprintf(buf, "%s/citadel.socket", ctdldir); server_socket = uds_connectsock(buf); if (server_socket < 0) { exit(1); } - printf(" \r"); sock_getln(server_socket, buf, sizeof buf); printf("%s\n", buf);