#!/usr/bin/env bash

exec > /dev/null

set -eu

if [ -f "$HOME/.password-store/www.majordomo.ru/gpg/master.gpg" ]
then
    gpg --decrypt --quiet --for-your-eyes-only --no-tty         \
        --pinentry-mode loopback                                \
        --passphrase "$(pass show www.majordomo.ru/gpg/master)" \
        "$HOME/.password-store/majordomo/private/eng/old.gpg"
fi

if [ -f "$HOME/.password-store/majordomo/private/eng/old.gpg" ]
then
    gpg --decrypt --quiet --for-your-eyes-only --no-tty         \
        --pinentry-mode loopback                                \
        --passphrase "$(pass show majordomo/private/eng/old)"   \
        "$HOME/.password-store/majordomo/public/router4/root.gpg"
fi
