Fix support for tunemu on iOS devices.
[oweals/tinc.git] / src / process.c
index a682226808725729c88f49796d00bb1d4902480b..b76e81cd3430d66161b66e2a6432d1407ace0b3d 100644 (file)
@@ -358,7 +358,7 @@ bool execute_script(const char *name, char **envp) {
        int status, len;
        char *scriptname;
        int i;
-    char *aInterpreter = NULL;
+       char *interpreter = NULL;
 
 #ifndef HAVE_MINGW
        len = xasprintf(&scriptname, "\"%s/%s\"", confbase, name);
@@ -370,28 +370,22 @@ bool execute_script(const char *name, char **envp) {
 
        scriptname[len - 1] = '\0';
 
-#ifndef HAVE_TUNEMU
        /* First check if there is a script */
 
        if(access(scriptname + 1, F_OK)) {
                free(scriptname);
                return true;
        }
-#endif
 
-    // Custom scripts interpreter
-    if(get_config_string(lookup_config(config_tree, "ScriptsInterpreter"), &aInterpreter))
-    {
-        // Force custom scripts interpreter allowing execution of scripts on android without execution flag (such as on /sdcard)
-        free(scriptname);
-        len = xasprintf(&scriptname, "%s \"%s/%s\"", aInterpreter, confbase, name);
-        if(len < 0)
-        {
-            free(aInterpreter);
-            return false;
-        }
-    }
-    free(aInterpreter);
+       // Custom scripts interpreter
+       if(get_config_string(lookup_config(config_tree, "ScriptsInterpreter"), &interpreter)) {
+               // Force custom scripts interpreter allowing execution of scripts on android without execution flag (such as on /sdcard)
+               free(scriptname);
+               len = xasprintf(&scriptname, "%s \"%s/%s\"", interpreter, confbase, name);
+               free(interpreter);
+               if(len < 0)
+                       return false;
+       }
 
        ifdebug(STATUS) logger(LOG_INFO, "Executing script %s", name);