You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
dotfiles/post-setup/gpg.sh

15 lines
388 B

#!/usr/bin/env bash
set -e
# don't require gpg key setup if user is root
if [ "$EUID" -eq 0 ]; then
return
fi
# prompt to create key if none exists
if [[ "$(find ~/.gnupg -maxdepth 2 -type f -wholename '*private-keys-v1.d/*.key' | wc -l)" == 0 ]]; then
echo 'No GPG keys found; creating one now.'
echo 'Using 4096 bit size is recommended for this setup.'
gpg --full-generate-key
fi