mirror of
https://github.com/jimeh/docker-znc.git
synced 2026-02-19 09:56:43 +00:00
Update ZNC to v1.6.1
And also restructure the Dockerfile a bit.
This commit is contained in:
35
docker-entrypoint.sh
Executable file
35
docker-entrypoint.sh
Executable file
@@ -0,0 +1,35 @@
|
||||
#! /usr/bin/env bash
|
||||
|
||||
# Options.
|
||||
DATADIR="/znc-data"
|
||||
|
||||
# Build modules from source.
|
||||
if [ -d "${DATADIR}/modules" ]; then
|
||||
# Store current directory.
|
||||
cwd="$(pwd)"
|
||||
|
||||
# Find module sources.
|
||||
modules=$(find "${DATADIR}/modules" -name "*.cpp")
|
||||
|
||||
# Build modules.
|
||||
for module in $modules; do
|
||||
cd "$(dirname "$module")"
|
||||
znc-buildmod "$module"
|
||||
done
|
||||
|
||||
# Go back to original directory.
|
||||
cd "$cwd"
|
||||
fi
|
||||
|
||||
# Create default config if it doesn't exist
|
||||
if [ ! -f "${DATADIR}/configs/znc.conf" ]; then
|
||||
mkdir -p "${DATADIR}/configs"
|
||||
cp /znc.conf.default "${DATADIR}/configs/znc.conf"
|
||||
fi
|
||||
|
||||
# Make sure $DATADIR is owned by znc user. This effects ownership of the
|
||||
# mounted directory on the host machine too.
|
||||
chown -R znc:znc "$DATADIR"
|
||||
|
||||
# Start ZNC.
|
||||
exec sudo -u znc znc --foreground --datadir="$DATADIR" $@
|
||||
Reference in New Issue
Block a user