Create user home if they exist, silently ignore
This commit is contained in:
parent
9f064da562
commit
7caf8d371d
13
install.bash
13
install.bash
@ -16,14 +16,11 @@ git clone --recurse-submodules https://gitlab.orion-technologies.io/game-servers
|
||||
sudo /bin/bash "${GENERAL_MODULE_PATH}/install.bash" "${GENERAL_MODULE_PATH}" || exit
|
||||
|
||||
# Create the user
|
||||
if [[ ! -d "${SDTD_USER_HOME}" ]]; then
|
||||
if id -u "${SDTD_USER_NAME}" > /dev/null 2>&1; then
|
||||
echo "Creating home directory for ${SDTD_USER_NAME}"
|
||||
mkdir -p "${SDTD_USER_HOME}"
|
||||
else
|
||||
echo "Creating user ${SDTD_USER_NAME}"
|
||||
sudo useradd -m -s /bin/bash "${SDTD_USER_NAME}" 2>/dev/null
|
||||
fi
|
||||
if id -u "${SDTD_USER_NAME}" > /dev/null 2>&1; then
|
||||
mkdir -p "${SDTD_USER_HOME}"
|
||||
else
|
||||
echo "Creating user ${SDTD_USER_NAME}"
|
||||
sudo useradd -m -s /bin/bash "${SDTD_USER_NAME}" 2>/dev/null
|
||||
fi
|
||||
|
||||
# Create the user .bin directory, I prefer .bin in scenarios in which I need
|
||||
|
Loading…
Reference in New Issue
Block a user