|
|
|
@ -27,6 +27,9 @@ fi
|
|
|
|
|
GRANT_SUDO=${GRANT_SUDO:-YES}
|
|
|
|
|
GRANT_SUDO=$(echo "${GRANT_SUDO}" | tr '[:lower:]' '[:upper:]')
|
|
|
|
|
|
|
|
|
|
USERNAME_PASSWORD_RESET=${USERNAME_PASSWORD_RESET:-NO}
|
|
|
|
|
USERNAME_PASSWORD_RESET=$(echo "${USERNAME_PASSWORD_RESET}" | tr '[:lower:]' '[:upper:]')
|
|
|
|
|
|
|
|
|
|
if [ "${GRANT_SUDO}" == "YES" ] && [ "${USERNAME}" != "root" ]; then
|
|
|
|
|
echo "${USERNAME} ALL=(ALL) NOPASSWD:ALL" >/etc/sudoers.d/one-context
|
|
|
|
|
chmod 0440 /etc/sudoers.d/one-context
|
|
|
|
@ -58,6 +61,6 @@ ${PASSWORD}
|
|
|
|
|
${PASSWORD}
|
|
|
|
|
EOF
|
|
|
|
|
fi
|
|
|
|
|
else
|
|
|
|
|
elif [ "${USERNAME_PASSWORD_RESET}" = 'YES' ]; then
|
|
|
|
|
usermod -p '*' "${USERNAME}"
|
|
|
|
|
fi
|
|
|
|
|