Advertisement
Guest User

Untitled

a guest
Mar 9th, 2017
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. #!/bin/bash
  2. read -p "Enter Your Username: " user
  3. echo -n Enter Your NEW Password:
  4. read -s password
  5. echo "******"
  6. newMvn=$(mvn --encrypt-master-password $password)
  7. echo "write to ~/.m2/securityS-settings.xml"
  8. echo -e "<settingsSecurity> \n\t <master>"$newMvn"</master> \n</settingsSecurity>" > ~/.m2/settings-security.xml
  9. echo "encrypt for npmrc"
  10. newCred=$( echo $user:$password | openssl base64 )
  11. echo "write to ~/.npmrc"
  12. sed -i .bak 's/^_auth=\".*/_auth="'$newCred'"/' ~/.npmrc
  13. rm ~/.npmrc.bak
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement