3 * SMS database consistency checker
5 * (c) Copyright 1988 by the Massachusetts Institute of Technology.
6 * For copying and distribution information, please see the file
10 #include <mit-copyright.h>
17 static char dbck_qc_rcsid[] = "$Header$";
25 struct hash *users, *machines, *clusters, *lists, *filesys, *nfsphys, *strings;
27 struct save_queue *modtables;
42 while (++arg - argv < argc) {
46 debug = atoi((*arg)[2] ? *arg+2 : *++arg);
70 printf("Usage: %s [-d level] [-n] [-y] [-p] [-a] [-c] [-f] [-w] [database]\n",
78 printf("Only doing counts\n");
80 printf("Doing fast version (skipping some checks)\n");
82 printf("Will NOT modify the database\n");
83 else if (mode == MODE_PREEN)
84 printf("Will fix simple things without asking\n");
85 else if (mode == MODE_YES)
86 printf("Will fix everything without asking\n");
88 printf("Debug level is %d\n", debug);
90 signal(SIGHUP, interrupt);
91 signal(SIGQUIT, interrupt);
92 signal(SIGINT, interrupt);
93 modtables = sq_create();
96 printf("Opening database %s...", database);
100 ## retrieve (dcmenable = values.value) where values.name = "dcm_enable"
101 dprintf("DCM disabled (was %d)\n", dcmenable);
102 ## replace values (value = 0) where values.name = "dcm_enable"
124 printf("An ingres error occuurred, code %d\n", *num);
125 printf("Aborting...\n");
136 printf("Signal caught\n");
137 if (prompt("Save database changes")) {
138 /* break out of a retrieve loop */
144 printf("Aborting transaction\n");
147 /* break out of a retrieve loop */
151 ## replace values (value = dcmenable) where values.name = "dcm_enable"
160 sq_save_unique_string(modtables, table);
167 while (sq_get_data(modtables, &tab)) {
168 ## replace tblstats (modtime = "now") where tblstats.table = tab
170 ## replace values (value = dcmenable) where values.name = "dcm_enable"