09/05/2023

scripts-4 querydb.sh

#! /usr/bin/expect

log_user 0
# set the variables Pimn to unlock Entity to get the required data
set Pin [lindex $argv 0 ]
set Entity [lindex $argv 1]
set pfad [lindex $argv 2]
#set pfad “/Users/can/Documents/filename.kdbx”

#call the DB
spawn /usr/local/bin/keepassxc-cli show -s -a Password -a UserName $pfad $Entity
expect “: ”
send “$Pin\r”
interact

Leave a Reply