#!/bin/bash
# -*- mode: sh; tab-width: 8; encoding: utf-8-unix -*-

prog=`basename $0 .bash`
PREFIX=/usr/local
ROLE=gpgkey
# DEBUG=1

. /usr/local/bin/usr_local_tput.bash

TTY=`tty`

PASS=`pyassuan_password.sh "$*" "pyassuan_keepassxc-cli"`
retval=$?
if [ $retval = 0 ] ; then
    ERROR retval=$retval
    exit $retval
fi


# No Gcr System Prompter available
echo $PASS | keepassxc-cli.bash "$@" 2>/tmp/Pyakc$$.err
retval=$?
if [ $retval -eq 0 ] ; then
    rm -f /tmp/Pyakc$$.err
else
    ERROR retval=$retval `cat /tmp/Pyakc$$.err` >&2
fi

