summaryrefslogtreecommitdiff
path: root/src/main/java
diff options
context:
space:
mode:
authorJoe Robinson <joe@lc8n.com>2015-12-10 17:19:51 +0000
committerJoe Robinson <joe@lc8n.com>2015-12-10 17:19:51 +0000
commite0a4ceb58b120d5f35faad077738a0dbb04552fa (patch)
treedde59fbeaea513ba8ab9320098f1f28165872528 /src/main/java
parent142e1bd42d653b3e48b22e455c6b6be1dc591f76 (diff)
Comment out the dangerous line
Diffstat (limited to 'src/main/java')
-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 ");