2010-10-17 21:50:55 +02:00
|
|
|
|
|
|
|
|
|
/// ===========================================================
|
|
|
|
|
|
|
|
|
|
int executable_run(char cmd[], char args[])
|
|
|
|
|
{
|
|
|
|
|
|
2017-01-06 22:23:13 +01:00
|
|
|
|
char exec[FILENAME_MAX];
|
2010-10-17 21:50:55 +02:00
|
|
|
|
int result;
|
|
|
|
|
|
2010-10-24 16:32:14 +02:00
|
|
|
|
if ( '/' == cmd[0]) // <20> <20><><EFBFBD><EFBFBD> <20><>᮫<EFBFBD><E1AEAB><EFBFBD><EFBFBD><EFBFBD>
|
2010-10-17 21:50:55 +02:00
|
|
|
|
{
|
|
|
|
|
strcpy(exec, cmd);
|
|
|
|
|
|
2010-10-21 01:58:36 +02:00
|
|
|
|
if ( !file_check(exec) ) // <20><EFBFBD><E0AEA2>塞 <20><><EFBFBD><EFBFBD><EFBFBD>⢮<EFBFBD><E2A2AE><EFBFBD><EFBFBD><EFBFBD> 䠩<><E4A0A9>
|
2010-10-17 21:50:55 +02:00
|
|
|
|
{
|
2012-04-16 12:40:07 +02:00
|
|
|
|
file_not_found(cmd);
|
2010-10-17 21:50:55 +02:00
|
|
|
|
return FALSE;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
else
|
|
|
|
|
{
|
2010-10-21 01:58:36 +02:00
|
|
|
|
strcpy(exec, cur_dir); // <20><EFBFBD><E0AEA2>塞 䠩<> <20> ⥪<>饬 <20><>⠫<EFBFBD><E2A0AB><EFBFBD>
|
2012-04-15 09:59:47 +02:00
|
|
|
|
if (exec[strlen(exec)-1] != '/')
|
|
|
|
|
strcat(exec, "/"); // add slash
|
2010-10-17 21:50:55 +02:00
|
|
|
|
strcat(exec, cmd);
|
|
|
|
|
|
2010-10-21 01:58:36 +02:00
|
|
|
|
if ( !file_check(exec) ) // <20><EFBFBD><E0AEA2>塞 <20><><EFBFBD><EFBFBD><EFBFBD>⢮<EFBFBD><E2A2AE><EFBFBD><EFBFBD><EFBFBD> 䠩<><E4A0A9>
|
2010-10-17 21:50:55 +02:00
|
|
|
|
{
|
2010-10-21 01:58:36 +02:00
|
|
|
|
strcpy(exec, "/rd/1/"); // <20><EFBFBD><E0AEA2>塞 䠩<> <20><> <20><><EFBFBD><EFBFBD>㠫쭮<E3A0AB> <20><>᪥
|
2010-10-17 21:50:55 +02:00
|
|
|
|
strcat(exec, cmd);
|
2010-10-21 01:58:36 +02:00
|
|
|
|
if ( !file_check(exec) ) // <20><EFBFBD><E0AEA2>塞 <20><><EFBFBD><EFBFBD><EFBFBD>⢮<EFBFBD><E2A2AE><EFBFBD><EFBFBD><EFBFBD> 䠩<><E4A0A9>
|
2010-10-17 21:50:55 +02:00
|
|
|
|
{
|
2012-04-16 12:40:07 +02:00
|
|
|
|
file_not_found(cmd);
|
2010-10-17 21:50:55 +02:00
|
|
|
|
return FALSE;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if ( script_check(exec) )
|
|
|
|
|
return script_run(exec, args);
|
|
|
|
|
|
2010-10-21 01:58:36 +02:00
|
|
|
|
/* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>ணࠬ<E0AEA3><E0A0AC> */
|
2010-10-17 21:50:55 +02:00
|
|
|
|
result = program_run(exec, args);
|
|
|
|
|
if (result > 0)
|
|
|
|
|
{
|
2012-03-23 19:53:16 +01:00
|
|
|
|
|
|
|
|
|
if ( !program_console(result) )
|
|
|
|
|
{
|
2017-01-06 17:12:57 +01:00
|
|
|
|
LAST_PID = result;
|
2012-03-23 19:53:16 +01:00
|
|
|
|
#if LANG_ENG
|
|
|
|
|
printf (" '%s' started. PID = %d\n\r", cmd, result);
|
|
|
|
|
#elif LANG_RUS
|
|
|
|
|
printf (" '%s' <20><><EFBFBD><EFBFBD>饭. PID = %d\n\r", cmd, result);
|
|
|
|
|
#endif
|
|
|
|
|
}
|
2010-10-17 21:50:55 +02:00
|
|
|
|
return TRUE;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2012-04-16 12:40:07 +02:00
|
|
|
|
file_not_found(cmd);
|
2010-10-17 21:50:55 +02:00
|
|
|
|
return FALSE;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// ===========================================================
|
2013-02-17 16:22:51 +01:00
|
|
|
|
|