Skip to content

Commit

Permalink
Fix password generate
Browse files Browse the repository at this point in the history
Retrieve the good chars chain to generate the password
  • Loading branch information
nicolas-brousse committed Aug 10, 2015
1 parent 7c36d74 commit 185a356
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions passgen
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,7 @@ error() {

# Generate password
genpasswd() {
local strings=$2
[ "$length" == "" ] && length=16
[ "$strings" == "" ] && strings=A-Za-z0-9_-
LC_CTYPE=C tr -dc ${strings} < /dev/urandom | head -c ${length} | xargs
LC_CTYPE=C tr -dc ${chars} < /dev/urandom | head -c ${length} | xargs
}

# Default values
Expand Down

0 comments on commit 185a356

Please sign in to comment.