02-password 581 B

1234567891011121314151617181920212223242526272829
  1. #!/bin/bash
  2. # Licence : GPL v3
  3. # Author: Laurent HUBERT
  4. #
  5. # Changes the root password
  6. #
  7. cat <<EOF
  8. +---------------------------------------------+
  9. | Changing super-user password |
  10. +---------------------------------------------+
  11. EOF
  12. status=1
  13. while [ 0 -ne "$status" ]
  14. do
  15. passwd
  16. status=$?
  17. if [ 0 -ne "$status" ]
  18. then
  19. echo "### Error changing super-user password ###"
  20. echo "Please try again"
  21. else
  22. echo "> super-user password : changed <"
  23. exit 0
  24. fi
  25. done
  26. echo "### An error occurred changing super-user password ###"
  27. exit $status