From: Guus Sliepen Date: Tue, 21 Mar 2017 20:25:27 +0000 (+0100) Subject: Add DEBUG environment variable for scripts. X-Git-Tag: release-1.1pre15~37 X-Git-Url: https://git.tinc-vpn.org/git/browse?a=commitdiff_plain;h=add75303e918af5e94ff545d969872799fac5cef;p=tinc Add DEBUG environment variable for scripts. This contains the current debug level used by tinc. Scripts can use it to decide whether to log debugging information of their own. Closes #138 on GitHub. --- diff --git a/src/script.c b/src/script.c index ceb6a1b4..1ce59ea0 100644 --- a/src/script.c +++ b/src/script.c @@ -105,6 +105,8 @@ void environment_init(environment_t *env) { environment_add(env, "DEVICE=%s", device); if(iface) environment_add(env, "INTERFACE=%s", iface); + if(debug_level >= 0) + environment_add(env, "DEBUG=%d", debug_level); } void environment_exit(environment_t *env) {