Improve password-store installation script with RSA and GPG key checks

This commit is contained in:
2025-03-18 22:14:31 +00:00
parent a916797cce
commit 27c2e6f726

View File

@@ -141,10 +141,15 @@ else
fi
# Clone password-store
if [ "$(whoami)" = "trude" ]; then
if [ "$USER" = "trude" ]; then
if [ ! -f "$HOME/.ssh/id_rsa" ] || [ ! -f "$HOME/.ssh/id_rsa.pub" ]; then
printf "${RED}RSA key not found. Please add your RSA key pair for password-store.${NC}\n"
elif ! gpg --list-keys "ehtrude@gmail.com" >/dev/null 2>&1; then
printf "${RED}GPG key for ehtrude@gmail.com not found. Please import the key for password-store.${NC}\n"
else
if [ ! -d "$HOME/.password-store" ]; then
printf "${YELLOW}Cloning password-store...${NC}\n"
git clone https://github.com/TrudeEH/password-store "$HOME/.password-store"
git clone git@github.com:TrudeEH/password-store.git "$HOME/.password-store"
if [ $? -ne 0 ]; then
printf "${RED}Error cloning password-store.${NC}\n"
else
@@ -154,6 +159,7 @@ if [ "$(whoami)" = "trude" ]; then
printf "${CYAN}Password-store already present.${NC}\n"
fi
fi
fi
# Security Scan
if [ ! -f "$HOME/dotfiles/logs/lynis_scan.log" ]; then