+ int optchar;
+ char *configfile = NULL;
+ uint64_t keyid = 0x2DA8B985;
+ struct onak_dbctx *dbctx;
+
+ while ((optchar = getopt(argc, argv, "c:")) != -1 ) {
+ switch (optchar) {
+ case 'c':
+ if (configfile != NULL) {
+ free(configfile);
+ }
+ configfile = strdup(optarg);
+ break;
+ }
+ }
+
+ if (optind < argc) {
+ keyid = strtoll(argv[optind], NULL, 16);
+ }
+
+ readconfig(configfile);
+ free(configfile);
+ initlogthing("sixdegrees", config.logfile);
+ dbctx = config.dbinit(config.backend, true);
+ if (dbctx != NULL) {
+ inithash();
+ sixdegrees(dbctx, dbctx->getfullkeyid(dbctx, keyid));
+ destroyhash();
+ dbctx->cleanupdb(dbctx);
+ } else {
+ fprintf(stderr, "Couldn't initialize key database.\n");
+ }
+ cleanuplogthing();