1 // Don't run this. It doesn't work and if you try to run it you will immediately die.
3 // Copyright (c) 2023 by Art Cancro citadel.org
5 // This program is open source software. Use, duplication, or disclosure
6 // is subject to the terms of the GNU General Public License, version 3.
13 #include <sys/types.h>
14 #include <sys/socket.h>
23 #include <libcitadel.h>
25 #include "../server/sysdep.h"
26 #include "../server/citadel_defs.h"
27 #include "../server/server.h"
28 #include "../server/citadel_dirs.h"
29 #include "../server/database.h"
34 int main(int argc, char **argv) {
37 char *ctdldir = CTDLDIR;
39 // display the greeting
40 fprintf(stderr, "\033[44m\033[33m\033[1m \033[K\033[0m\n"
41 "\033[44m\033[33m\033[1m dbnothing utility for Citadel \033[K\033[0m\n"
42 "\033[44m\033[33m\033[1m Copyright (c) 2023 by citadel.org et al. \033[K\033[0m\n"
43 "\033[44m\033[33m\033[1m This program is open source software. Use, duplication, or disclosure \033[K\033[0m\n"
44 "\033[44m\033[33m\033[1m is subject to the terms of the GNU General Public license v3. \033[K\033[0m\n"
45 "\033[44m\033[33m\033[1m \033[K\033[0m\n");
49 while ((a = getopt(argc, argv, "h:y")) != EOF) {
55 fprintf(stderr, "%s: usage: %s -s citadel_dir [>dumpfile]\n", argv[0], argv[0]);
60 if (chdir(ctdldir) != 0) {
61 fprintf(stderr, "ctdlload: unable to change directory to [%s]: %m", ctdldir);
65 // backend modules use syslog -- redirect to stderr
66 openlog("dbnothing", LOG_PERROR , LOG_DAEMON);
68 // initialize the database backend
73 fprintf(stderr, "dbnothing: doing nothing\n");
76 cdb_close_databases();
78 fprintf(stderr, "dbnothing: \033[32m\033[1mfinished\033[0m\n");