]> code.citadel.org Git - citadel.git/commitdiff
* migratenet.c: added (not even close to being finished)
authorArt Cancro <ajc@citadel.org>
Sat, 20 Oct 2001 18:10:50 +0000 (18:10 +0000)
committerArt Cancro <ajc@citadel.org>
Sat, 20 Oct 2001 18:10:50 +0000 (18:10 +0000)
citadel/ChangeLog
citadel/migratenet.c [new file with mode: 0644]

index 173d752132e965a6dfce57a8f79eb6c6d3a496b8..a9876287fa549c36184019f81439a83e708013c3 100644 (file)
@@ -1,4 +1,7 @@
  $Log$
+ Revision 580.67  2001/10/20 18:10:50  ajc
+ * migratenet.c: added (not even close to being finished)
+
  Revision 580.66  2001/10/17 21:07:20  nbryant
  further format string cleanups (for i686-linux type sizes)
 
@@ -2831,4 +2834,3 @@ Sat Jul 11 00:20:48 EDT 1998 Nathan Bryant <bryant@cs.usm.maine.edu>
 
 Fri Jul 10 1998 Art Cancro <ajc@uncensored.citadel.org>
        * Initial CVS import 
-
diff --git a/citadel/migratenet.c b/citadel/migratenet.c
new file mode 100644 (file)
index 0000000..50b4407
--- /dev/null
@@ -0,0 +1,59 @@
+/*
+ * $Id$
+ * 
+ * 5.80 to 5.90 migration utility for network files
+ *
+ */
+
+#include <stdlib.h>
+#include <unistd.h>
+#include <stdio.h>
+#include <string.h>
+#include "citadel.h"
+#include "ipc.h"
+#include "tools.h"
+
+extern struct config config;
+
+void logoff(int code)
+{
+       exit(code);
+}
+
+int main(int argc, char **argv)
+{
+       char buf[SIZ];
+       char hostbuf[SIZ];
+       char portbuf[SIZ];
+
+       printf("\n\n\n\n\n"
+"This utility migrates your network settings (room sharing with other\n"
+"Citadel systems) from 5.80 to 5.90.  You should only do this ONCE.  It\n"
+"will ERASE your 5.80 configuration files when it is finished, and it will\n"
+"ERASE any 5.90 configuration files that you have already set up.\n\n"
+"Are you sure you want to do this? ");
+
+       gets(buf);
+       if (tolower(buf[0]) != 'y') exit(0);
+
+       get_config();
+
+       attach_to_server(argc, argv, hostbuf, portbuf);
+       serv_gets(buf);
+       printf("%s\n", &buf[4]);
+       if ((buf[0]!='2')&&(strncmp(buf,"551",3))) {
+               fprintf(stderr,"%s: %s\n",argv[0],&buf[4]);
+               logoff(atoi(buf));
+       }
+
+       printf("%s\n", buf);
+       serv_puts(buf);
+       serv_gets(buf);
+       fprintf(stderr, "%s\n", &buf[4]);
+       if (buf[0] != '2') {
+               exit(2);
+       }
+
+
+       printf("FIXME not finished yet\n");
+}