- return STR_SSH + " " + STR_USERNAME + strIoTSlaveControllerHostAdd + " cd " +
- STR_SLAVE_DIR + " sudo " + STR_IOTSLAVE_CPP + " " + strIoTMasterHostAdd + " " +
- commHan.getComPort(strObjControllerName) + " " + strObjControllerName;
+ // Create an Shell executable
+ String strCppCommand = STR_SHELL_HEADER + "\ncd " + STR_SLAVE_DIR + " exec sudo " +
+ STR_IOTSLAVE_CPP + " " + strIoTMasterHostAdd + " " +
+ commHan.getComPort(strObjControllerName) + " " + strObjControllerName;;
+ String shellFile = "./" + strObjControllerName + STR_SHELL_FILE_EXT;
+ createWrapperShellScript(strCppCommand, shellFile);
+ // Send the file to the compute node
+ String strCmdSend = STR_SCP + " " + shellFile + " " + STR_USERNAME + strIoTSlaveControllerHostAdd + ":" + STR_RUNTIME_DIR;
+ runCommand(strCmdSend);
+ System.out.println("IoTMaster: Sending main controller shell file: " + strCmdSend);
+ return STR_SSH + " " + STR_USERNAME + strIoTSlaveControllerHostAdd + " cd " + STR_RUNTIME_DIR + " " + shellFile;