0121c38e2b8ece8691908516304b4f2174811a82
[projects.git] / Test / xFhem / bin / install-sysal-stub
1 #!/bin/bash
2 set -e
3
4 # test if apache-conf already installed
5 if [ -e /etc/apache2/sites-enabled/sysal_stub.conf ]
6 then
7         exit
8 fi
9
10 mkdir -p /var/test
11 chmod 777 /var/test
12
13 cwd=$(pwd)
14 # write apache conf
15 echo "# Apache conf for sysal stub
16 Alias /sysal/rest/AlarmInterface/RemoteWatchdog $cwd/bin/sysal-stub.pl
17 <Directory $cwd/bin>
18        Require all granted
19        Options +ExecCGI
20        AddHandler cgi-script .pl
21 </Directory>
22 " > /etc/apache2/sites-available/sysal_stub.conf
23 a2ensite sysal_stub
24 a2enmod cgi
25
26 systemctl restart apache2
27