aboutsummaryrefslogtreecommitdiff
path: root/bash/bashrc.d/pwgen.bash
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2014-10-01 14:18:58 +1300
committerTom Ryder <tom@sanctum.geek.nz>2014-10-01 14:18:58 +1300
commitd816b311497484d1c9b965358fe357141546611b (patch)
tree67565e6d2584270f634886061bb6d16c90f1a284 /bash/bashrc.d/pwgen.bash
parentRemove/install/clean plugins individually (diff)
downloaddotfiles-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.bash15
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
+}
+