-
Notifications
You must be signed in to change notification settings - Fork 16
Expand file tree
/
Copy pathrun.sh
More file actions
executable file
·35 lines (29 loc) · 1.19 KB
/
run.sh
File metadata and controls
executable file
·35 lines (29 loc) · 1.19 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/bin/sh
# copy the prepared conf file and include it
cd /test/
FILECONF=$(filename $CONF)
if [ -f $CONF ]; then
cp $CONF /usr/local/apache2/conf/
echo "Include conf/$FILECONF" >> /usr/local/apache2/conf/httpd.conf
else
echo "The given CONF file: $CONF does not exist"
exit 1
fi
# podman networking can't do rDNS, so REMOTE_HOST is an IP address instead of
# a hostname meaning the `Require host ...` does not work.
# Because of that, we'll add a `Require ip ...` upon podman detection
if grep -qc 'search dns.podman' /etc/resolv.conf; then
PODMAN_SUBNET=$(sed -rn 's/nameserver ([0-9]+)\.([0-9]+)\.([0-9]+).*/\1\.\2\.\3\./p' /etc/resolv.conf)
echo "Podman detected: Changing Require host to Require ip $PODMAN_SUBNET"
sed -i "s/Require host \.mod_proxy_cluster_testsuite_net/Require ip ${PODMAN_SUBNET}/" /usr/local/apache2/conf/$FILECONF
fi
if [ ! -z "$MPC_NAME" ]; then
sed -i "s/ServerName httpd-mod_proxy_cluster/ServerName ${MPC_NAME}/g" /usr/local/apache2/conf/$FILECONF
fi
mkdir /coverage
# start apache httpd server in foreground
echo "Starting httpd..."
/usr/local/apache2/bin/httpd -X &
sleep 1
tail -f /usr/local/apache2/logs/error_log
while true; do cat /dev/null; done;