/*
- * (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.
*/
#include <readline/readline.h>
#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;
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')) {
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) {
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);