| 123456789101112131415161718192021222324252627282930 |
- #!/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
- echo "> $the_user password : changed <"
- exit 0
- fi
- done
- echo "### An error occurred changing $the_user password ###"
- exit $status
|