From eda6326d35e65098e08518a2c6b499709f8ee67e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?=
Date: Thu, 2 Feb 2017 18:44:11 +0100
Subject: Add web
---
web/add_msg.sh | 43 +++++++++++++++++++++++++++++++++++++++++++
1 file changed, 43 insertions(+)
create mode 100755 web/add_msg.sh
(limited to 'web/add_msg.sh')
diff --git a/web/add_msg.sh b/web/add_msg.sh
new file mode 100755
index 0000000..a956335
--- /dev/null
+++ b/web/add_msg.sh
@@ -0,0 +1,43 @@
+#!/bin/sh
+set -e
+
+echo "Content-type:text/html
+";
+
+if [ "$REQUEST_METHOD" != "POST" ]; then
+ echo "Wrong request method"
+ exit 0
+fi
+
+if grep -q "$REMOTE_ADDR" /tmp/turris-lcd-did; then
+ echo "
+
+
+ Turris Omnia Feed
+
+ We already have post from you.
+
+ "
+ exit 0
+else
+ echo "$REMOTE_ADDR" >> /tmp/turris-lcd-did
+fi
+
+MESSAGE="$(cat | sed 's/message=//;s/+/ /g')"
+
+echo "
+
+
+ Turris Omnia Feed
+
+ Thank you for your message
+ $(cat<
+"
+
+cat >/tmp/turris-lcd <