Merge pull request #27 from baby-gnu/feature/set-user-crypted-password

Set ${CRYPTED_PASSWORD} for ${USERNAME}
pull/31/head
Javi Fontan 9 years ago
commit 12ee268e9d

@ -16,7 +16,7 @@
# limitations under the License. #
#--------------------------------------------------------------------------- #
[ -n "${PASSWORD}" ] || exit 0
[ -n "${PASSWORD}${CRYPTED_PASSWORD}" ] || exit 0
if [ -z "${USERNAME}" ]
then
@ -29,4 +29,10 @@ then
exit 0
fi
chpasswd <<< "${USERNAME}:${PASSWORD}"
if [ -n "${PASSWORD}" ]
then
chpasswd <<< "${USERNAME}:${PASSWORD}"
elif [ -n "${CRYPTED_PASSWORD}" ]
then
usermod -p "${CRYPTED_PASSWORD}" "${USERNAME}"
fi

Loading…
Cancel
Save