mirror of
https://github.com/gensokyo-zone/infrastructure.git
synced 2026-02-09 12:29:19 -08:00
12 lines
320 B
Bash
12 lines
320 B
Bash
#!/bin/bash
|
|
set -eu
|
|
set -o pipefail
|
|
|
|
if gpg --card-status &> /dev/null; then
|
|
user="$(gpg --card-status | grep 'Login data' | awk '{print $NF}')";
|
|
status='{"text": "", "alt": "User: '"$user"'", "class": "enabled"}'
|
|
else
|
|
status='{"text": "", "alt": "No card is connected.", "class": "disabled"}'
|
|
fi
|
|
|
|
echo $status
|