diff --git a/include/constant.h b/include/constant.h index 75140d2..fd4ce04 100644 --- a/include/constant.h +++ b/include/constant.h @@ -12,7 +12,7 @@ #define DIVERTER_TIMEOUT 6 -#define VERSION "1.3.0-beta1" +#define VERSION "1.3.0-beta2" #define CONFIG_FILE "cleardns.yml" #define ADGUARD_USER "admin" diff --git a/src/cleardns.c b/src/cleardns.c index 0e9d5d9..18c1f22 100644 --- a/src/cleardns.c +++ b/src/cleardns.c @@ -17,6 +17,12 @@ char* init(int argc, char *argv[]) { // return config file char *config = string_init(CONFIG_FILE); + if (getenv("CONFIG") != NULL) { + config = string_init(getenv("CONFIG")); + } + if (getenv("DEBUG") != NULL && !strcmp(getenv("DEBUG"), "TRUE")) { + LOG_LEVEL = LOG_DEBUG; // enable debug mode + } for (int i = 0; i < argc; ++i) { if (!strcmp(argv[i], "--debug")) { LOG_LEVEL = LOG_DEBUG; // enable debug mode