From 0f08d04698c814955116b6bae50752e64b774d8f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Romain=20Gon=C3=A7alves?= Date: Thu, 23 Dec 2021 18:28:03 +0000 Subject: Thu Dec 23 06:28:03 PM UTC 2021 --- .bin/show-pass | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100755 .bin/show-pass (limited to '.bin/show-pass') diff --git a/.bin/show-pass b/.bin/show-pass new file mode 100755 index 0000000..568570e --- /dev/null +++ b/.bin/show-pass @@ -0,0 +1,22 @@ +#!/bin/sh + +usage () { + cat >&2 <<-EOF + usage: ${0} password_regexp + EOF +} + +log () { + echo ["${0}"] $@ >&2 +} + +main() { + # verify arguments + [ "${#}" -ne 1 ] && usage && exit 1 + + # retrieve password + log "retrieving password for : ${1}" + gopass show --password $(gopass ls --flat | grep "${1}" | head -n 1) +} + +main $@ -- cgit v1.2.3