fae34cb2df0b78df8b2f46aa122fda8c3c11c9b3
[xhome.git] / TestXfhem / 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
25 systemctl restart apache2
26