epic-ukulele
[xhome.git] / TestXfhem / bin / install-sysal-stub
diff --git a/TestXfhem/bin/install-sysal-stub b/TestXfhem/bin/install-sysal-stub
new file mode 100755 (executable)
index 0000000..26f6b0d
--- /dev/null
@@ -0,0 +1,23 @@
+#!/bin/bash
+set -e
+
+# test if already installed
+if [ -e /etc/apache2/sites-enabled/sysal_stub.conf ]
+then
+       exit
+fi
+
+cwd=$(pwd)
+# write apache conf
+echo "# Apache conf for sysal stub
+Alias /sysal/rest/AlarmInterface/RemoteWatchdog $cwd/bin/sysal-stub.pl
+<Directory $cwd/bin>
+       Require all granted
+       Options +ExecCGI
+       AddHandler cgi-script .pl
+</Directory>
+" > /etc/apache2/sites-available/sysal_stub.conf
+a2ensite sysal_stub
+
+systemctl restart apache2
+