Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/zsh
- username=$1
- password=$2
- db=synapse-homeserver
- [[ -z $username ]] || [[ -z $password ]] && { print "usage: $0 <username> <password>"; exit; }
- password_hash=$(python -c "import bcrypt; print bcrypt.hashpw(\"$password\", bcrypt.gensalt())")
- echo $password_hash
- psql -c "update users set password_hash = '$password_hash' where name = '$username'" $db
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement