mirror of
https://github.com/eclipse-mosquitto/mosquitto.git
synced 2026-05-05 01:53:01 +02:00
These arefor setting the user/group to drop privileges to. Closes #2441. Thanks to matthewparkes.
17 lines
256 B
Bash
Executable file
17 lines
256 B
Bash
Executable file
#!/bin/ash
|
|
set -e
|
|
|
|
# Set permissions
|
|
user="$(id -u)"
|
|
if [ "$PUID" = "" ]; then
|
|
PUID="mosquitto"
|
|
fi
|
|
if [ "$PGID" = "" ]; then
|
|
PGID="mosquitto"
|
|
fi
|
|
if [ "$user" = '0' ]; then
|
|
[ -d "/mosquitto" ] && chown -R ${PUID}:${PGID} /mosquitto || true
|
|
fi
|
|
|
|
exec "$@"
|