You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
docker-ircd/atheme/root/entrypoint.sh

35 lines
872 B

3 years ago
#!/bin/sh
DATADIR=/srv/data/etc
mkdir -p "$DATADIR"
chown atheme:atheme -R "$DATADIR"
if [ ! -e $DATADIR/atheme.conf ]; then
echo "Configuration file not found. Generating it..."
cp /srv/atheme/etc/atheme.conf.example $DATADIR/atheme.conf
fi
if ! test -w "$DATADIR/"; then
echo "ERROR: $DATADIR must be mounted to a directory writable by UID $ATHEME_UID"
exit 1
fi
DBPATH="$DATADIR/services.db"
if test -f "$DBPATH" && ! test -r "$DBPATH"; then
echo "ERROR: $DBPATH must be readable by UID $ATHEME_UID"
exit 1
fi
TMPPATH="$DATADIR/services.db.new"
if test -f "$TMPPATH" && ! test -w "$TMPPATH"; then
echo "ERROR: $TMPPATH must either not exist or be writable by UID $ATHEME_UID"
exit 1
fi
rm -f /srv/atheme/var/atheme.pid
su atheme -c "/srv/atheme/bin/atheme-services \
-c $DATADIR/atheme.conf \
-n"