| 12345678910111213141516171819202122232425262728293031323334 |
- #!/bin/bash
- # Licence : GPL v3
- # Author: Laurent HUBERT
- #
- # Changes the default user's password (id=1000)
- #
- # Default user should have id 1000:
- the_user=$(id -u 1000 -n)
- cat <<EOF
- ##################################
- # Changing $the_user password #
- ##################################
- EOF
- status=1
- while [ 0 -ne "$status" ]
- do
- passwd $the_user
- status=$?
- if [ 0 -ne "$status" ]
- then
- echo "Error changing $the_user password"
- echo "Please try again"
- else
- cat <<EOF
- **********************************
- * $the_user password : changed *
- **********************************
- EOF
- exit 0
- fi
- done
- echo "An error occurred changing $the_user password"
- exit $status
|