0
0
Fork 0
mirror of https://github.com/nextcloud/docker.git synced 2025-03-14 18:35:08 +01:00
nextcloud-docker/docker-entrypoint.sh

19 lines
489 B
Bash
Raw Normal View History

#!/bin/sh
set -eu
2016-07-30 15:30:52 +01:00
if [ "$(id -u)" = 0 ]; then
>&2 echo 'Warning - Running as root is not recommended for security reasons.'
2017-04-17 22:49:53 +02:00
fi
if ! id -nu >/dev/null 2>&1; then
# If there is no entry for the running user ID in the UNIX password file,
# provide an identity for the user
if [ -w /etc/passwd ]; then
cat /etc/passwd > /tmp/passwd
echo "nextcloud:x:$(id -u):0:Nextcloud user:/root:/sbin/nologin" >> /tmp/passwd
cat /tmp/passwd > /etc/passwd
rm /tmp/passwd
fi
2016-07-30 15:30:52 +01:00
fi
exec "$@"