+ read_config_options(config_tree, name);
+
+ snprintf(fname, sizeof(fname), "%s" SLASH "hosts" SLASH "%s", confbase, name);
+ x = read_config_file(config_tree, fname);
+
+ return x;
+}
+
+bool append_config_file(const char *name, const char *key, const char *value) {
+ char fname[PATH_MAX];
+ snprintf(fname, sizeof(fname), "%s" SLASH "hosts" SLASH "%s", confbase, name);
+
+ FILE *fp = fopen(fname, "a");
+
+ if(!fp) {
+ logger(DEBUG_ALWAYS, LOG_DEBUG, "Cannot open config file %s: %s", fname, strerror(errno));
+ return false;
+ }
+
+ fprintf(fp, "\n# The following line was automatically added by tinc\n%s = %s\n", key, value);
+ fclose(fp);
+ return true;