ubuntu compatible password change function

This commit is contained in:
Serghey Rodin 2013-06-23 17:27:07 +03:00
commit c1dad6ce08
5 changed files with 22 additions and 16 deletions

View file

@ -38,7 +38,7 @@ is_object_unsuspended 'user' 'USER' "$user"
#----------------------------------------------------------#
# Changing user password
echo "$password" | /usr/bin/passwd "$user" --stdin &>/dev/null
echo "$user:$password" | /usr/sbin/chpasswd
md5=$(awk -v user=$user -F : 'user == $1 {print $2}' /etc/shadow)