File: gen-httpd-conf

package info (click to toggle)
rabbitmq-server 4.0.5-6
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 37,948 kB
  • sloc: erlang: 257,835; javascript: 22,466; sh: 2,796; makefile: 2,517; python: 1,966; xml: 646; cs: 335; java: 244; ruby: 212; php: 100; perl: 63; awk: 13
file content (20 lines) | stat: -rwxr-xr-x 637 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/usr/bin/env bash
SCRIPT="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"

#set -x

TEST_PATH=${1:?First parameter is the directory env and config files are relative to}
ENV_FILE=${2:?Second parameter is a comma-separated list of .env file which has exported template variables}
FINAL_CONFIG_FILE=${3:?Forth parameter is the name of the final config file. It is relative to where this script is run from}

source $ENV_FILE

parentdir="$(dirname "$FINAL_CONFIG_FILE")"
mkdir -p $parentdir

echo "" > $FINAL_CONFIG_FILE

for f in $($SCRIPT/find-template-files $TEST_PATH "httpd" "conf")
do
  envsubst < $f  >> $FINAL_CONFIG_FILE
done