2020-10-15 13:31:50 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
|
|
|
# Ensure $HOME exists when starting
|
|
|
|
if [ ! -d "${HOME}" ]; then
|
|
|
|
mkdir -p "${HOME}"
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Setup $PS1 for a consistent and reasonable prompt
|
2021-03-17 07:51:28 +00:00
|
|
|
if [ -w "${HOME}" ] && [ -d /etc/skel ]; then
|
|
|
|
cp /etc/skel/.bash* "${HOME}"
|
2020-10-15 13:31:50 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
# Add current (arbitrary) user to /etc/passwd and /etc/group
|
|
|
|
if ! whoami &> /dev/null; then
|
|
|
|
if [ -w /etc/passwd ]; then
|
|
|
|
echo "${USER_NAME:-user}:x:$(id -u):0:${USER_NAME:-user} user:${HOME}:/bin/bash" >> /etc/passwd
|
|
|
|
echo "${USER_NAME:-user}:x:$(id -u):" >> /etc/group
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
2021-07-08 07:43:45 +00:00
|
|
|
set +e
|
|
|
|
if [ -f "/etc/profile.d/devtoolset-7.sh" ]; then
|
|
|
|
source "/etc/profile.d/devtoolset-7.sh"
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ -f "/etc/profile.d/llvm-toolset-7.sh" ]; then
|
|
|
|
source "/etc/profile.d/llvm-toolset-7.sh"
|
|
|
|
fi
|
|
|
|
set -e
|
|
|
|
|
2020-10-15 13:31:50 +00:00
|
|
|
exec "$@"
|