From b997c20887816a1f3f1f8e01abadf2852b20c09c Mon Sep 17 00:00:00 2001 From: Evan Pratten Date: Wed, 7 Jun 2023 23:42:25 -0400 Subject: [PATCH] genpass --- configs/zsh/macros.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/configs/zsh/macros.sh b/configs/zsh/macros.sh index dc65edd..76d2c84 100644 --- a/configs/zsh/macros.sh +++ b/configs/zsh/macros.sh @@ -85,3 +85,13 @@ extract() { echo "'$1' is not a valid file!" fi } + +# Generate a password +genpass() { + if [ $# != 1 ]; then + echo "Usage: genpass " + else + echo $(openssl rand -base64 $1 | tr -d "\n") + fi + +}