mosquitto/docker/2.0-openssl/docker-entrypoint.sh

18 lines
523 B
Bash
Raw Normal View History

2020-12-02 22:43:42 +00:00
#!/bin/ash
set -e
# Set permissions
user="$(id -u)"
if [ "$user" = '0' ]; then
[ -d "/mosquitto" ] && chown -R mosquitto:mosquitto /mosquitto || true
fi
if [ "$NO_AUTHENTICATION" = "1" ] && [ "$*" = '/usr/sbin/mosquitto -c /mosquitto/config/mosquitto.conf' ]; then
# The user wants to run Mosquitto with no authentication, but without
# providing a configuration file. Use the pre-provided file for this.
exec /usr/sbin/mosquitto -c /mosquitto-no-auth.conf
else
# Execute whatever command is requested
exec "$@"
fi