safety is cool actually

This commit is contained in:
kat witch 2021-03-26 00:56:25 +00:00
parent 23e5dc8270
commit a49f61028a
No known key found for this signature in database
GPG key ID: 1B477797DCA5EC72

View file

@ -1,7 +1,8 @@
#!/bin/bash
set -eu
set -o pipefail
gpg --card-status &> /dev/null;
if [ $? -eq 0 ] || [ $? -eq 2 ]; then
if gpg --card-status &> /dev/null; then
user="$(gpg --card-status | grep 'Login data' | awk '{print $NF}')";
else
user=" Disconnected"