summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/main/java/uk/co/blatech/blaears/controllers/MsgRelayController.java7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/main/java/uk/co/blatech/blaears/controllers/MsgRelayController.java b/src/main/java/uk/co/blatech/blaears/controllers/MsgRelayController.java
index 43a5439..664030f 100644
--- a/src/main/java/uk/co/blatech/blaears/controllers/MsgRelayController.java
+++ b/src/main/java/uk/co/blatech/blaears/controllers/MsgRelayController.java
@@ -7,12 +7,17 @@ import org.springframework.web.bind.annotation.RequestParam;
import java.io.IOException;
+/**
+ * Sends the input text to the msgrelay bash script
+ * Just for testing. Don't uncomment that runtime line in live, it's dangerous
+ */
@Controller
public class MsgRelayController {
@RequestMapping("/msgrelay")
String relay(@RequestParam(value="text", required=true) String text, Model model){
try {
- Runtime.getRuntime().exec(new String[]{"/bin/bash", "-c", "echo theblueroom test " + text + " | bash /home/smsd/msgrelay.bash "});
+ //DANGER
+ //Runtime.getRuntime().exec(new String[]{"/bin/bash", "-c", "echo theblueroom " + text + " | bash /home/smsd/msgrelay.bash "});
model.addAttribute("result", "OK");
} catch (IOException e) {
System.out.println("Failed to run command echo theblueroom test " + text + " | bash /home/smsd/msgrelay.bash ");