4 * 5.80 to 5.90 migration utility for network files
12 #include <sys/types.h>
26 int main(int argc, char **argv)
40 "This utility migrates your network settings (room sharing with other\n"
41 "Citadel systems) from 5.80 to 5.90. You should only do this ONCE. It\n"
42 "will ERASE your 5.80 configuration files when it is finished, and it will\n"
43 "ERASE any 5.90 configuration files that you have already set up.\n\n"
44 "Are you sure you want to do this? ");
47 if (tolower(buf[0]) != 'y') exit(0);
51 attach_to_server(argc, argv, hostbuf, portbuf);
53 printf("%s\n", &buf[4]);
54 if ( (buf[0]!='2') && (strncmp(buf,"551",3)) ) {
55 fprintf(stderr, "%s: %s\n", argv[0], &buf[4]);
59 sprintf(buf, "IPGM %d", config.c_ipgm_secret);
62 fprintf(stderr, "%s\n", &buf[4]);
67 if (chdir("network/systems") != 0) {
68 perror("cannot chdir network/systems");
74 perror("cannot open temp file");
80 perror("cannot open directory");
84 while (d = readdir(dp), d != NULL) {
86 if ( (d->d_name[0] != '.') && strcasecmp(d->d_name, "CVS")) {
87 fp = fopen(d->d_name, "r");
90 printf("*** Processing '%s'\n", d->d_name);
91 while (fgets(room, sizeof room, fp),
92 fscanf(fp, "%ld\n", &thighest),
94 room[strlen(room) - 1] = 0;
95 fprintf(tempfp, "%s|%s\n",
97 if (thighest > highest) {