12 lines
299 B
Bash
12 lines
299 B
Bash
|
|
cardstat() {
|
||
|
|
local workdir="${GNUPGHOME:-$HOME/.gnupg}"
|
||
|
|
|
||
|
|
if ! gpg --card-status &>/dev/null; then
|
||
|
|
systemctl restart pcscd;
|
||
|
|
fi
|
||
|
|
touch "${workdir}/unlock.txt";
|
||
|
|
gpg --sign "${workdir}/unlock.txt";
|
||
|
|
rm -f "${workdir}/unlock.txt.gpg";
|
||
|
|
rm -f "${workdir}/unlock.txt";
|
||
|
|
gpg --card-status;
|
||
|
|
}
|