X-Git-Url: https://git.madduck.net/etc/pass.git/blobdiff_plain/a358236ea029464ce74ffe97ddb353685074666f..ea4e649b88bfe7872e80dce9c6da2e6a893bc3e7:/.bin/genpw-editor diff --git a/.bin/genpw-editor b/.bin/genpw-editor new file mode 100755 index 0000000..108f1b6 --- /dev/null +++ b/.bin/genpw-editor @@ -0,0 +1,15 @@ +#!/bin/sh +set -eu + +if command -v diceware >/dev/null; then + PW_GENERATOR='diceware -s2' + +elif command -v pwgen >/dev/null; then + PW_GENERATOR='pwgen -y 20 1' + +else + PW_GENERATOR='dd if=/dev/random bs=256 count=1 | base64' + +fi + +exec vim -c 'set noshelltemp' -c "0read! $PW_GENERATOR" -c 2d -n