add support fro $OTR_BROWSERAPIKEY from environment

closes #156
This commit is contained in:
Jan-Piet Mens
2016-10-11 19:48:34 +02:00
parent a13b55c18a
commit 536d1bbdf7
2 changed files with 6 additions and 1 deletions

View File

@@ -277,7 +277,7 @@ The following configuration settings may be applied (a `Y` in column `$` means a
| `OTR_LUASCRIPT` | | | Path to the Lua script
| `OTR_PRECISION` | | `7` | Reverse-geo precision
| `OTR_GEOKEY` | | | API key for reverse-geo lookups
| `OTR_BROWSERAPIKEY` | | | Google maps browser API key
| `OTR_BROWSERAPIKEY` | Y | | Google maps browser API key
| `OTR_TOPICS` | | | String containing a space-separated list of topics to subscribe to for MQTT (overridden by command-line arguments)
| `OTR_CAFILE` | Y | | Path to PEM-encoded CA certificate file for MQTT (implicitly enables TLS)

View File

@@ -1278,6 +1278,11 @@ int main(int argc, char **argv)
}
#endif
if ((p = getenv("OTR_BROWSERAPIKEY")) != NULL) {
if (ud->browser_apikey)
free(ud->browser_apikey);
ud->browser_apikey = strdup(p);
}
while (1) {
static struct option long_options[] = {