summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2021-05-04 20:08:34 +0200
committerErich Eckner <git@eckner.net>2021-05-04 20:08:34 +0200
commit4cbbd7caec3a9e1ed5324e75df3c0da25e33d93b (patch)
treefc90a4ede57c9d3f87ea5eeff0283a6e2b6ab06b
parent880e7a8883bb306fe27309e297ca4fd4111716fb (diff)
downloadpasswort-tresor-4cbbd7caec3a9e1ed5324e75df3c0da25e33d93b.tar.xz
passwort-tresor.in: extend alphabet to all printable ASCII
-rw-r--r--passwort-tresor.in13
1 files changed, 10 insertions, 3 deletions
diff --git a/passwort-tresor.in b/passwort-tresor.in
index c64aa02..024eb31 100644
--- a/passwort-tresor.in
+++ b/passwort-tresor.in
@@ -164,9 +164,16 @@ then
fi
else
pw1=$(
- head -c ${pwLen} /dev/urandom | \
- base64 | \
- head -c ${pwLen}
+ printf '%s\n' {0..1}{0..7}{0..7} \
+ | sed '
+ 1,33d
+ $d
+ ' \
+ | while read -r s; do
+ printf '\'"$s"'\n'
+ done \
+ | shuf -n ${pwLen} --random-source=/dev/urandom -r \
+ | tr -d '\n'
)
fi
fi