mirror of
https://github.com/jimeh/docker-znc.git
synced 2026-02-19 01:46:42 +00:00
32 lines
652 B
Bash
Executable File
32 lines
652 B
Bash
Executable File
#! /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 /src/znc.conf.default "${DATADIR}/configs/znc.conf"
|
|
fi
|
|
|
|
# Start ZNC.
|
|
exec znc --foreground --datadir="$DATADIR" $@
|