epic-ukulele
authorMichael Wagner <michael@wagnertech.de>
Tue, 25 Feb 2020 02:01:38 +0000 (03:01 +0100)
committerMichael Wagner <michael@wagnertech.de>
Tue, 25 Feb 2020 02:01:38 +0000 (03:01 +0100)
TestXfhem/FitnessePages/AaaPrepare/content.txt [new file with mode: 0644]
TestXfhem/FitnessePages/AaaPrepare/properties.xml [new file with mode: 0644]
TestXfhem/bin/install-sysal-stub [new file with mode: 0755]
TestXfhem/bin/sysal-stub.pl [new file with mode: 0755]

diff --git a/TestXfhem/FitnessePages/AaaPrepare/content.txt b/TestXfhem/FitnessePages/AaaPrepare/content.txt
new file mode 100644 (file)
index 0000000..5fa4f14
--- /dev/null
@@ -0,0 +1,4 @@
+Sysal-Stub installieren
+
+!|test.util.CallScript|
+|call script|sudo bin/install-sysal-stub|
diff --git a/TestXfhem/FitnessePages/AaaPrepare/properties.xml b/TestXfhem/FitnessePages/AaaPrepare/properties.xml
new file mode 100644 (file)
index 0000000..3e87512
--- /dev/null
@@ -0,0 +1,12 @@
+<?xml version="1.0"?>
+<properties>
+       <Edit>true</Edit>
+       <Files>true</Files>
+       <Properties>true</Properties>
+       <RecentChanges>true</RecentChanges>
+       <Refactor>true</Refactor>
+       <Search>true</Search>
+       <Test/>
+       <Versions>true</Versions>
+       <WhereUsed>true</WhereUsed>
+</properties>
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
+
diff --git a/TestXfhem/bin/sysal-stub.pl b/TestXfhem/bin/sysal-stub.pl
new file mode 100755 (executable)
index 0000000..40b0e85
--- /dev/null
@@ -0,0 +1,14 @@
+#!/usr/bin/perl -w
+
+print "Content-type: text/html\n\n";
+print "<html><body>\n";
+
+
+open (OUT, ">/tmp/sysal-stub.out");
+while (my $line = <STDIN>) {
+       print OUT "$line\n";
+       print "$line\n";
+}
+
+print "</body></html>\n";
+