-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathentrypoint.sh
More file actions
39 lines (35 loc) · 1007 Bytes
/
entrypoint.sh
File metadata and controls
39 lines (35 loc) · 1007 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
33
34
35
36
37
38
39
#!/bin/bash
# Install plugins
actual_dir=$(pwd)
cd /opt/CTFd/CTFd/plugins/
echo "Installing plugins"
# For each var that starts with GIT_PLUGINS_
for var in "${!GIT_PLUGINS_@}"; do
echo "Installing plugin from ${!var}"
# Split the var into an array of 2 elements
IFS=',' read -ra REPO <<< "${!var}"
# If destination exists, skip
if [ -d "${REPO[1]}" ]; then
echo "Already installed theme ${REPO[0]}"
continue
fi
git clone "${REPO[0]}" "${REPO[1]}"
done
# Install themes
cd /opt/CTFd/CTFd/themes/
echo "Installing themes"
# For each var that starts with GIT_THEMES_
for var in "${!GIT_THEMES_@}"; do
echo "Installing theme from ${!var}"
# Split the var into an array of 2 elements
IFS=',' read -ra REPO <<< "${!var}"
# If destination exists, skip
if [ -d "${REPO[1]}" ]; then
echo "Already installed theme ${REPO[0]}"
continue
fi
git clone "${REPO[0]}" "${REPO[1]}"
done
cd "$actual_dir"
# Run CTFd original entrypoint
exec /opt/CTFd/docker-entrypoint.sh "$@"