51 {(char *)"mysql_database", getstr, (char **)&Config.mysql_database}, |
51 {(char *)"mysql_database", getstr, (char **)&Config.mysql_database}, |
52 {(char *)"mqtt_host", getstr, (char **)&Config.mqtt_host}, |
52 {(char *)"mqtt_host", getstr, (char **)&Config.mqtt_host}, |
53 {(char *)"mqtt_port", getint, (char **)&Config.mqtt_port}, |
53 {(char *)"mqtt_port", getint, (char **)&Config.mqtt_port}, |
54 {(char *)"mqtt_user", getstr, (char **)&Config.mqtt_user}, |
54 {(char *)"mqtt_user", getstr, (char **)&Config.mqtt_user}, |
55 {(char *)"mqtt_pass", getstr, (char **)&Config.mqtt_pass}, |
55 {(char *)"mqtt_pass", getstr, (char **)&Config.mqtt_pass}, |
|
56 {(char *)"web_root", getstr, (char **)&Config.web_root}, |
56 {NULL, NULL, NULL} |
57 {NULL, NULL, NULL} |
57 }; |
58 }; |
58 |
59 |
59 |
60 |
60 |
61 |
148 fprintf(fp, "#mqtt_user <username>\n"); |
153 fprintf(fp, "#mqtt_user <username>\n"); |
149 if (Config.mqtt_pass) |
154 if (Config.mqtt_pass) |
150 fprintf(fp, "mqtt_pass %s\n", Config.mqtt_pass); |
155 fprintf(fp, "mqtt_pass %s\n", Config.mqtt_pass); |
151 else |
156 else |
152 fprintf(fp, "#mqtt_pwd <passwd>\n"); |
157 fprintf(fp, "#mqtt_pwd <passwd>\n"); |
153 |
158 fprintf(fp, "#\n"); |
|
159 |
|
160 if (Config.web_root) |
|
161 fprintf(fp, "web_root %s\n", Config.web_root); |
|
162 else |
|
163 fprintf(fp, "#web_root </path/to/webroot>\n"); |
154 fprintf(fp, "#\n"); |
164 fprintf(fp, "#\n"); |
155 fprintf(fp, "# End of generated configuration\n"); |
165 fprintf(fp, "# End of generated configuration\n"); |
156 fclose(fp); |
166 fclose(fp); |
157 free(mypath); |
167 free(mypath); |
158 mypath = NULL; |
168 mypath = NULL; |