|
@@ -17,6 +17,8 @@
|
|
|
#include "CodeSignVerify.h"
|
|
|
#include <fstream>
|
|
|
#include <ostream>
|
|
|
+#include <string>
|
|
|
+#include <vector>
|
|
|
|
|
|
|
|
|
#define MAX_ENTITY_LEN 33
|
|
@@ -36,6 +38,17 @@
|
|
|
#define T_ARRAY_MAKE(n, size, shm) \
|
|
|
shm ? shm_array_make(n, size) : array_make(n, size)
|
|
|
|
|
|
+std::vector<std::string> g_arrKill;
|
|
|
+std::vector<std::string> g_arrStart;
|
|
|
+
|
|
|
+std::vector<std::string> getKillArr() {
|
|
|
+ return g_arrKill;
|
|
|
+}
|
|
|
+
|
|
|
+std::vector<std::string> getStartArr() {
|
|
|
+ return g_arrStart;
|
|
|
+}
|
|
|
+
|
|
|
static int verify_entity_name(const char *name)
|
|
|
{
|
|
|
const char *p = name;
|
|
@@ -872,9 +885,52 @@ static int load_shell_ini(sp_dir_t *dir, sp_cfg_shell_ini_t *shell, sp_cfg_root_
|
|
|
shell->shell_debug_level = 0;
|
|
|
|
|
|
shell->nConsolePort = inifile_read_int(file, "Main", "ConsolePort", 0);
|
|
|
+
|
|
|
+ auto killNum = inifile_read_int(file, "killProcess", "Number", 0);
|
|
|
+ g_arrKill.clear();
|
|
|
+ for (int i = 1; i <= killNum; i++)
|
|
|
+ {
|
|
|
+ char key[512];
|
|
|
+ char* s;
|
|
|
+ _itoa(i, key, 10);
|
|
|
+ s = inifile_read_str(file, "killProcess", key, "");
|
|
|
+ if (s && strlen(s) > 0) {
|
|
|
+ g_arrKill.push_back(s);
|
|
|
+ toolkit_free(s);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ sp_dbg_warn("read kill failed! killProcess list [%s] define invalid!", key);
|
|
|
+ rc = Error_Param;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ auto startNum = inifile_read_int(file, "RunScript", "Number", 0);
|
|
|
+ g_arrStart.clear();
|
|
|
+ for (int i = 1; i <= startNum; i++)
|
|
|
+ {
|
|
|
+ char key[512];
|
|
|
+ char* s;
|
|
|
+ _itoa(i, key, 10);
|
|
|
+ s = inifile_read_str(file, "RunScript", key, "");
|
|
|
+ if (s && strlen(s) > 0) {
|
|
|
+ std::string fullPath = std::string(dir->bin_path) + "\\spScript\\" + s;
|
|
|
+ g_arrStart.push_back(fullPath);
|
|
|
+ toolkit_free(s);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ sp_dbg_warn("read start failed! RunScript list [%s] define invalid!", key);
|
|
|
+ rc = Error_Param;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
return rc;
|
|
|
}
|
|
|
|
|
|
+
|
|
|
static int unload_shell_ini(sp_cfg_shell_ini_t *shell)
|
|
|
{
|
|
|
int i;
|