monolithic/overlay/scripts/getconfig.sh
VibroAxe faa6b3969d Rebase generic off monolithic
This commit rebases the generic code into the monolithic image
This allows the base image to be the more regularly accessed / edited image

Commits to lancachenet/generic:switcheroo will mimic this commit

Also fixes lancachenet/generic#108
2021-07-20 12:04:38 +00:00

39 lines
601 B
Bash
Executable file

#!/bin/bash
get_file_contents() {
FILES=$1
local FILE;
for FILE in $FILES; do
echo "# Including $FILE"
local LINE
while read LINE; do
CLEANLINE=`echo $LINE | sed -e 's/^[[:space:]]*//g' -e 's/[[:space:]]*\$//g'`
if [[ "$CLEANLINE" =~ ^include ]]; then
local CL_LEN
local INCUDE
CL_LEN=${#CLEANLINE}-9;
INCLUDE=${CLEANLINE:8:$CL_LEN}
get_file_contents "$INCLUDE"
else
echo $LINE
fi
done < $FILE
echo "# Finished including $FILE"
done
}
main() {
echo "NGINX CONFIG DUMP FOR $1"
cd `dirname $1`
get_file_contents $1
}
main `readlink -f $1`