2
0
mirror of https://github.com/processone/docker-ejabberd synced 2024-11-10 13:10:37 +00:00
docker-ejabberd/ejabberd-base/docker-entrypoint.sh

29 lines
495 B
Bash
Raw Normal View History

#!/bin/bash
set -e
if [ "${1:0:1}" = '-' ]; then
set -- ejabberd "$@"
fi
if [ "$1" = 'ejabberd' ]; then
mkdir -p "$P1DATA"
chmod 700 "$P1DATA"
chown -R p1 "$P1DATA"
mkdir -p "$P1LOG"
chmod 700 "$P1LOG"
chown -R p1 "$P1LOG"
su-exec p1 $HOME/ejabberd/bin/ejabberd foreground
fi
if [ "$1" = 'console' ]; then
mkdir -p "$P1DATA"
chmod 700 "$P1DATA"
chown -R p1 "$P1DATA"
mkdir -p "$P1LOG"
chmod 700 "$P1LOG"
chown -R p1 "$P1LOG"
su-exec p1 $HOME/ejabberd/bin/ejabberd console
fi