-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathdocker-sourcebans-entrypoint.sh
More file actions
32 lines (26 loc) · 959 Bytes
/
docker-sourcebans-entrypoint.sh
File metadata and controls
32 lines (26 loc) · 959 Bytes
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
#!/usr/bin/env bash
#
# Performs setup tasks on container start
set -euo pipefail
# Copy Sourcebans sourcecode to docroot
if [ "true" == $INSTALL ]; then
rm -rf /var/www/html/themes/default /var/www/html/updater /var/www/html/install /var/www/html/pages /var/www/html/includes
cp -R /usr/src/sourcebans/* /var/www/html/
fi
# If $INSTALL is set to false or not set, remove the install and updater directories
if [ "false" == $INSTALL ] || [ -z ${INSTALL+x} ]; then
if [ -d /var/www/html/install/ ]; then
rm -R /var/www/html/install/
fi
if [ -d /var/www/html/updater/ ]; then
rm -R /var/www/html/updater/
fi
fi
# Temporary fix until https://github.com/sbpp/sourcebans-pp/issues/972 is resolved
if [ ! -d /var/www/html/cache ]; then
mkdir /var/www/html/cache
fi
if [ "true" == $SET_OWNER ] && [ "$(id -u)" -eq 0 ]; then
chown -R $SET_OWNER_UID:$SET_OWNER_GID /var/www/html
fi
exec "docker-php-entrypoint" $@