int status, len;
char *scriptname;
int i;
+ char *interpreter = NULL;
#ifndef HAVE_MINGW
len = xasprintf(&scriptname, "\"%s/%s\"", confbase, name);
scriptname[len - 1] = '\0';
-#ifndef HAVE_TUNEMU
/* First check if there is a script */
if(access(scriptname + 1, F_OK)) {
free(scriptname);
return true;
}
- else
- {
- // Ugly hard-code allowing execution of scripts on android without execution flag (such as on /sdcard)
- free(scriptname);
- len = xasprintf(&scriptname, "/system/bin/sh \"%s/%s\"", confbase, name);
- if(len < 0)
- {
- return false;
- }
- }
-#endif
+
+ // 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);