Guest User

Untitled

a guest
Sep 9th, 2018
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.37 KB | None | 0 0
  1. #!/usr/bin/env bash
  2.  
  3. set -e
  4.  
  5. if [ -z "$1" ]
  6. then
  7. echo "Missing destination file parameter."
  8. echo "Usage: $0 path/to/dest"
  9. echo "Example: $0 /srv/registry/security/htpasswd"
  10. exit 1;
  11. fi
  12.  
  13. DEST=$1
  14.  
  15. echo "Enter the new username:"
  16. read -r USERNAME
  17.  
  18. echo "Enter the associated password:"
  19. read -rs PASSWORD
  20.  
  21. docker run registry:2 htpasswd -Bbn ${USERNAME} ${PASSWORD} >> $DEST
Add Comment
Please, Sign In to add comment