diff --git a/base/etc/one-context.d/10-set-username-password b/base/etc/one-context.d/10-set-username-password index 4f3bc4e..f4c3793 100755 --- a/base/etc/one-context.d/10-set-username-password +++ b/base/etc/one-context.d/10-set-username-password @@ -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