- char *envp[5] = {NULL};
- xasprintf(&envp[0], "NETNAME=%s", netname ? : "");
- xasprintf(&envp[1], "DEVICE=%s", device ? : "");
- xasprintf(&envp[2], "INTERFACE=%s", iface ? : "");
- xasprintf(&envp[3], "NAME=%s", myname);
-
- execute_script("tinc-down", envp);
-
- for(int i = 0; i < 4; i++)
- free(envp[i]);
+ environment_t env;
+ environment_init(&env);
+ execute_script("tinc-down", &env);
+ environment_exit(&env);