Files
PacketStation/docker/entrypoint.sh
T

22 lines
711 B
Bash
Raw Normal View History

#!/usr/bin/env bash
# Container entrypoint. tini runs this as PID 1's child.
# Usage: app | worker | migrate [--bootstrap-roles] | doctor | version | healthcheck app|worker
set -euo pipefail
# MFilesKit reads its password from the environment only, so export it from the secret file.
# VisualKit, ldap3 and the database settings read their *_FILE paths directly.
mfiles_secret=/run/secrets/mfileskit_password
if [[ -r "$mfiles_secret" ]]; then
MFILES_PASSWORD="$(<"$mfiles_secret")"
# Drop a trailing carriage return left by an editor on Windows.
MFILES_PASSWORD="${MFILES_PASSWORD%$'\r'}"
export MFILES_PASSWORD
fi
unset mfiles_secret
if [[ $# -eq 0 ]]; then
set -- app
fi
exec packetstation "$@"