|
|
@ -24,6 +24,13 @@ if ! getent passwd "${USERNAME}" > /dev/null 2>&1; then
|
|
|
|
useradd -m "${USERNAME}"
|
|
|
|
useradd -m "${USERNAME}"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if [ "${GRANT_SUDO}" == "YES" -a "${USERNAME}" != "root" ]; then
|
|
|
|
|
|
|
|
if [ ! -f /etc/sudoers.d/${USERNAME} ]; then
|
|
|
|
|
|
|
|
echo "${USERNAME} ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/${USERNAME}
|
|
|
|
|
|
|
|
chmod 644 /etc/sudoers.d/${USERNAME}
|
|
|
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
if [ -n "${CRYPTED_PASSWORD_BASE64}" ]; then
|
|
|
|
if [ -n "${CRYPTED_PASSWORD_BASE64}" ]; then
|
|
|
|
CRYPTED_PASSWORD=$(echo $CRYPTED_PASSWORD_BASE64 | base64 -d)
|
|
|
|
CRYPTED_PASSWORD=$(echo $CRYPTED_PASSWORD_BASE64 | base64 -d)
|
|
|
|
usermod -p "${CRYPTED_PASSWORD}" "${USERNAME}"
|
|
|
|
usermod -p "${CRYPTED_PASSWORD}" "${USERNAME}"
|
|
|
|