aboutsummaryrefslogtreecommitdiff
path: root/bash/bashrc.d/pwgen.bash
blob: df39274ff0812cbfc12d7db536ab9a6d36692dc3 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
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
}