atheme-docker/entrypoint.sh

23 lines
594 B
Bash
Raw Normal View History

#!/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
2020-05-10 00:01:41 -07:00
rm -f /atheme/var/atheme.pid
/atheme/bin/atheme-services -n "$@"