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$";
23 struct hash *users, *machines, *clusters, *lists, *filesys, *nfsphys, *strings;
25 struct save_queue *modtables;
40 while (++arg - argv < argc) {
44 debug = atoi((*arg)[2] ? *arg+2 : *++arg);
69 printf("Only doing counts\n");
71 printf("Doing fast version (skipping some checks)\n");
73 printf("Will NOT modify the database\n");
74 else if (mode == MODE_PREEN)
75 printf("Will fix simple things without asking\n");
76 else if (mode == MODE_YES)
77 printf("Will fix everything without asking\n");
79 printf("Debug level is %d\n", debug);
81 signal(SIGHUP, interrupt);
82 signal(SIGQUIT, interrupt);
83 signal(SIGINT, interrupt);
84 modtables = sq_create();
87 printf("Opening database %s...", database);
91 ## retrieve (dcmenable = values.value) where values.name = "dcm_enable"
92 dprintf("DCM disabled (was %d)\n", dcmenable);
93 ## replace values (value = 0) where values.name = "dcm_enable"
115 printf("An ingres error occuurred, code %d\n", *num);
116 printf("Aborting...\n");
124 printf("Signal caught\n");
125 if (prompt("Save database changes")) {
130 printf("Aborting transaction\n");
132 ## replace values (value = dcmenable) where values.name = "dcm_enable"
141 sq_save_unique_string(modtables, table);
148 while (sq_get_data(modtables, &tab)) {
149 ## replace tblstats (modtime = "now") where tblstats.table = tab
151 ## replace values (value = dcmenable) where values.name = "dcm_enable"