forked from mriedmann/humhub-docker
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add dummy script to deploy configuration
- Loading branch information
1 parent
17fa80b
commit 0eaf5d7
Showing
1 changed file
with
30 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#!/bin/sh | ||
# This script reads configuration options for a file provided via environment variable | ||
# HUMHUB_CONFIG_FILE and applies the settings sequentially to this container during startup. | ||
|
||
#TODO: Disable when mature | ||
set -x | ||
|
||
echo "Configuring HumHub options" | ||
CONFIG_FILE="${HUMHUB_CONFIG_FILE:-none}" | ||
|
||
# Stop if nothing needs to be done. | ||
if [[ "${CONFIG_FILE}" == "none" ]]; then | ||
echo -e "No config file (or name none) provided, aborting..." | ||
exit 0 | ||
fi | ||
|
||
# Check the file actually exists and is readable and has content. | ||
if [[ ! -r "${CONFIG_FILE}" ]]; then | ||
echo -e "Config file ${CONFIG_FILE} either does not exist or is not readable." | ||
fi | ||
if [[ ! -s "${CONFIG_FILE}" ]]; then | ||
echo -e "Config file ${CONFIG_FILE} seems to be empty." | ||
fi | ||
|
||
# Actually do the stuff. | ||
grep -v '^#' "${CONFIG_FILE}" | while read -r LINE; do | ||
# su -s /bin/sh nginx -c "php yii settings/set "${moduleId}" "${name}" "${value}" --interactive=0" | ||
# su -s /bin/sh nginx -c "php yii settings/set ${LINE} --interactive=0" | ||
echo -e "Found config line: ${LINE}" | ||
done |