All checks were successful
Build Docker image and publish / docker (push) Successful in 14m54s
45 lines
1.2 KiB
Bash
Executable file
45 lines
1.2 KiB
Bash
Executable file
#!/bin/bash
|
|
|
|
if [ -n "$FD_PLUGINS" ]; then
|
|
apt-get update
|
|
plugins=()
|
|
for plugin in $FD_PLUGINS; do
|
|
plugins+=("fusiondirectory-plugin-$plugin")
|
|
done
|
|
apt-get install -yy "${plugins[@]}"
|
|
fi
|
|
|
|
: "${APACHE_CONFDIR:=/etc/apache2}"
|
|
: "${APACHE_ENVVARS:=$APACHE_CONFDIR/envvars}"
|
|
if test -f "$APACHE_ENVVARS"; then
|
|
. "$APACHE_ENVVARS"
|
|
fi
|
|
|
|
# Apache gets grumpy about PID files pre-existing
|
|
: "${APACHE_RUN_DIR:=/var/run/apache2}"
|
|
: "${APACHE_PID_FILE:=$APACHE_RUN_DIR/apache2.pid}"
|
|
rm -f "$APACHE_PID_FILE"
|
|
|
|
# create missing directories
|
|
# (especially APACHE_RUN_DIR, APACHE_LOCK_DIR, and APACHE_LOG_DIR)
|
|
for e in "${!APACHE_@}"; do
|
|
if [[ "$e" == *_DIR ]] && [[ "${!e}" == /* ]]; then
|
|
# handle "/var/lock" being a symlink to "/run/lock", but "/run/lock" not existing beforehand, so "/var/lock/something" fails to mkdir
|
|
# mkdir: cannot create directory '/var/lock': File exists
|
|
dir="${!e}"
|
|
while [ "$dir" != "$(dirname "$dir")" ]; do
|
|
dir="$(dirname "$dir")"
|
|
if [ -d "$dir" ]; then
|
|
break
|
|
fi
|
|
absDir="$(readlink -f "$dir" 2>/dev/null || :)"
|
|
if [ -n "$absDir" ]; then
|
|
mkdir -p "$absDir"
|
|
fi
|
|
done
|
|
|
|
mkdir -p "${!e}"
|
|
fi
|
|
done
|
|
|
|
exec apache2 -DFOREGROUND "$@"
|