diff options
author | Mike Crute <mike@crute.us> | 2020-01-09 19:19:49 +0000 |
---|---|---|
committer | Mike Crute <mike@crute.us> | 2020-01-09 19:23:51 +0000 |
commit | 1fe8647502560320171b3ff19c34945d23a29c75 (patch) | |
tree | ec9d9dbcda9cc6d8d6cc2e3c21cc79d5b24266a6 /bin | |
parent | edd8d49f13f5abb402d68e4f4672cf700e72b232 (diff) | |
download | dotfiles-1fe8647502560320171b3ff19c34945d23a29c75.tar.bz2 dotfiles-1fe8647502560320171b3ff19c34945d23a29c75.tar.xz dotfiles-1fe8647502560320171b3ff19c34945d23a29c75.zip |
Import password script
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/secure-passwd.sh | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/bin/secure-passwd.sh b/bin/secure-passwd.sh index 25a4ef1..82362f4 100755 --- a/bin/secure-passwd.sh +++ b/bin/secure-passwd.sh | |||
@@ -1,6 +1,8 @@ | |||
1 | #!/bin/bash | 1 | #!/bin/bash |
2 | 2 | ||
3 | pass=$(dd if=/dev/urandom count=1 bs=32 2>&1 | base64 | tr -dc '[:alnum:]' | cut -b -26) | 3 | #recipe="[:graph:]" |
4 | recipe="[:alnum:]" | ||
5 | read -r -n 26 pass < <(LC_ALL=C tr -dc "$recipe" < /dev/urandom) | ||
4 | if [ "$1" = "-n" ]; then | 6 | if [ "$1" = "-n" ]; then |
5 | echo -n $pass | 7 | echo -n $pass |
6 | else | 8 | else |