mirror of
https://gitee.com/milvus-io/milvus.git
synced 2024-12-02 11:59:00 +08:00
d66d48c6b6
Signed-off-by: quicksilver <zhifeng.zhang@zilliz.com>
25 lines
649 B
Bash
Executable File
25 lines
649 B
Bash
Executable File
#!/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
|
|
if [ -w "${HOME}" ] && [ ! -f "${HOME}"/.bashrc ]; then
|
|
echo "PS1='\s-\v \w \$ '" > "${HOME}"/.bashrc
|
|
echo -e 'if [ -f /etc/bashrc ]; then\n . /etc/bashrc\nfi' >> "${HOME}"/.bashrc
|
|
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
|
|
|
|
exec "$@"
|