String shellFile = "./" + strObjName + STR_SHELL_FILE_EXT;
createWrapperShellScript(strJavaCommand, shellFile);
// Send the file to the compute node
- String strCmdSend = "scp " + shellFile + " " + STR_USERNAME + strIoTSlaveObjectHostAdd + ":" + STR_RUNTIME_DIR;
+ String strCmdSend = STR_SCP + " " + shellFile + " " + STR_USERNAME + strIoTSlaveObjectHostAdd + ":" + STR_RUNTIME_DIR;
runCommand(strCmdSend);
RuntimeOutput.print("IoTMaster: Sending shell file: " + strCmdSend, BOOL_VERBOSE);
return STR_SSH + " " + STR_USERNAME + strIoTSlaveObjectHostAdd + " cd " + STR_RUNTIME_DIR + " " + shellFile;
*/
private String getCmdCppDriverIoTSlave(String strIoTMasterHostAdd, String strIoTSlaveObjectHostAdd, String strObjName) {
- return STR_SSH + " " + STR_USERNAME + strIoTSlaveObjectHostAdd + " cd " +
- STR_SLAVE_DIR + " sudo " + STR_IOTSLAVE_CPP + " " + strIoTMasterHostAdd + " " +
- commHan.getComPort(strObjName) + " " + strObjName;
+ // Create an Shell executable
+ String strCppCommand = STR_SHELL_HEADER + "\ncd " + STR_SLAVE_DIR + " exec sudo " + STR_IOTSLAVE_CPP + " " +
+ strIoTMasterHostAdd + " " + commHan.getComPort(strObjName) + " " + strObjName;
+ String shellFile = "./" + strObjName + STR_SHELL_FILE_EXT;
+ createWrapperShellScript(strCppCommand, shellFile);
+ // Send the file to the compute node
+ String strCmdSend = STR_SCP + " " + shellFile + " " + STR_USERNAME + strIoTSlaveObjectHostAdd + ":" + STR_RUNTIME_DIR;
+ runCommand(strCmdSend);
+ RuntimeOutput.print("IoTMaster: Sending shell file: " + strCmdSend, BOOL_VERBOSE);
+ return STR_SSH + " " + STR_USERNAME + strIoTSlaveObjectHostAdd + " cd " + STR_RUNTIME_DIR + " " + shellFile;
}
String shellFile = "./" + strObjControllerName + STR_SHELL_FILE_EXT;
createWrapperShellScript(strJavaCommand, shellFile);
// Send the file to the compute node
- String strCmdSend = "scp " + shellFile + " " + STR_USERNAME + strIoTSlaveControllerHostAdd + ":" + STR_RUNTIME_DIR;
+ 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;
*/
private String getCmdCppIoTSlave(String strObjControllerName) {
- 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;
}