Files
docker-steam-headless/overlay/etc/cont-init.d/10-setup_user.sh
Josh.5 0008e05848 Improvements to the init process
Move some files to locations that make more sense...
Downloads go to Downloads
Init scripts go to an "init" directory
Add a script for clearing up some memory - May or may not use it.
2022-01-12 20:53:55 +13:00

32 lines
728 B
Bash

PUID=${PUID:-99}
PGID=${PGID:-100}
UMASK=${UMASK:-000}
USER_PASSWORD=${USER_PASSWORD:-password}
echo "**** Configure default user ****"
echo "Setting run user uid=${PGID}(${USER}) gid=${PUID}(${USER})"
groupmod -o -g "${PGID}" ${USER}
usermod -o -u "${PUID}" ${USER}
echo "Setting umask to ${UMASK}";
umask ${UMASK}
# Setup home directory and permissions
echo "Adding default home directory template"
mkdir -p ${USER_HOME}
chown -R ${PUID}:${PGID} /etc/home_directory_template
rsync -aq /etc/home_directory_template/ ${USER_HOME}/
# Set the root and user password
echo "Setting root password"
echo "root:${USER_PASSWORD}" | chpasswd
echo "Setting user password"
echo "${USER}:${USER_PASSWORD}" | chpasswd
echo "DONE"