atheme-docker/entrypoint.sh
2020-05-10 00:13:04 -07:00

22 lines
594 B
Bash
Executable file

#!/bin/sh
DATADIR=/atheme/etc
if ! test -w "$DATADIR/"; then
echo "ERROR: $DATADIR must be mounted to a directory writable by UID $(cat /.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 $(cat /.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 $(cat /.atheme_uid)"
exit 1
fi
rm -f /atheme/var/atheme.pid
/atheme/bin/atheme-services -n "$@"