docker-minecraft-server/minecraft-server/start
2018-08-18 16:56:45 -05:00

20 lines
409 B
Bash
Executable File

#!/bin/bash
if [ $(id -u) = 0 ]; then
if [[ -v UID && $UID != $(id -u) ]]; then
usermod -u $UID minecraft
fi
if [[ -v GID ]]; then
groupmod -g $GID minecraft
fi
if [[ $(stat -c "%u" /data) != $UID ]]; then
echo "Changing ownership of /data to $UID ..."
chown -R minecraft:minecraft /data
fi
su-exec minecraft:minecraft /start-configuration
else
exec /start-configuration
fi