I have a script I use to change passwords on my MAC's, what I'd really like to do is have the script check the password to see if it is different before attempting to change it.
Go to Solution.
This should do what you are looking for:
PASSWORDCHECK=$(/usr/bin/dscl /Local/Default -authonly $USERNAME $PASSWORD)
if [ "$PASSWORDCHECK" == "" ]; then
echo "Password is correct"
echo "Lets reset"
View solution in original post