Richard Allred
2019-05-23 497620c4d1bcb410267c56351432f87fb3aee5a4
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
35
36
37
38
39
40
41
#!/bin/bash
 
set -e
 
source ${HTTPD_CONTAINER_SCRIPTS_PATH}/common.sh
 
echo "---> Enabling s2i support in httpd24 image"
 
config_s2i
 
######## CUSTOMIZATION STARTS HERE ############
 
echo "---> Installing application source"
cp -Rf /tmp/src/*.html ./
 
DATE=`date "+%b %d, %Y @ %H:%M %p"`
 
echo "---> Creating info page"
echo "Page built on $DATE" >> ./info.html
echo "Proudly served by Apache HTTP Server version $HTTPD_VERSION" >> ./info.html
 
######## CUSTOMIZATION ENDS HERE ############
 
if [ -d ./httpd-cfg ]; then
  echo "---> Copying httpd configuration files..."
  if [ "$(ls -A ./httpd-cfg/*.conf)" ]; then
    cp -v ./httpd-cfg/*.conf "${HTTPD_CONFIGURATION_PATH}"
    rm -rf ./httpd-cfg
  fi
else
  if [ -d ./cfg ]; then
    echo "---> Copying httpd configuration files from deprecated './cfg' directory, use './httpd-cfg' instead..."
    if [ "$(ls -A ./cfg/*.conf)" ]; then
      cp -v ./cfg/*.conf "${HTTPD_CONFIGURATION_PATH}"
      rm -rf ./cfg
    fi
  fi
fi
 
# Fix source directory permissions
fix-permissions ./