diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2014-10-01 14:18:58 +1300 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2014-10-01 14:18:58 +1300 |
commit | d816b311497484d1c9b965358fe357141546611b (patch) | |
tree | 67565e6d2584270f634886061bb6d16c90f1a284 /bash/bashrc.d/pwgen.bash | |
parent | Remove/install/clean plugins individually (diff) | |
download | dotfiles-d816b311497484d1c9b965358fe357141546611b.tar.gz dotfiles-d816b311497484d1c9b965358fe357141546611b.zip |
Wrapper for pwgen to give it sensible defaults
Diffstat (limited to 'bash/bashrc.d/pwgen.bash')
-rw-r--r-- | bash/bashrc.d/pwgen.bash | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/bash/bashrc.d/pwgen.bash b/bash/bashrc.d/pwgen.bash new file mode 100644 index 00000000..f3ab323b --- /dev/null +++ b/bash/bashrc.d/pwgen.bash @@ -0,0 +1,15 @@ +# Bail if no pwgen(1) +if ! hash pwgen 2>/dev/null ; then + return +fi + +# Set some defaults for pwgen, because its defaults are to give me a long list +# of relatively short passwords, when I generally want only one good one +pwgen() { + if (($#)) ; then + command pwgen "$@" + else + command pwgen -s "${PWGEN_LENGTH:-15}" "${PWGEN_COUNT:-1}" + fi +} + |