Fixed a couple errors in gpg setup.
This commit is contained in:
parent
8da27787b7
commit
63b298bf2c
@ -96,10 +96,10 @@ configure_gpg()
|
|||||||
echo -e 'GPG_TTY=$(tty)\nexport GPG_TTY' >> ~/.bashrc
|
echo -e 'GPG_TTY=$(tty)\nexport GPG_TTY' >> ~/.bashrc
|
||||||
fi
|
fi
|
||||||
# Make sure the configuration directory exists
|
# Make sure the configuration directory exists
|
||||||
if ! [ -d !/.gnupg/ ]; then
|
if ! [ -d ~/.gnupg/ ]; then
|
||||||
mkdir -p ~/.gnupg
|
mkdir -p ~/.gnupg
|
||||||
fi
|
fi
|
||||||
if [ -f !/.gnupg/gpg.conf ]; then
|
if [ -f ~/.gnupg/gpg.conf ]; then
|
||||||
read -p "This will overwrite your existing ~/.gnupg/gpg.conf file. Press enter to continue or control+c to abort. " continue
|
read -p "This will overwrite your existing ~/.gnupg/gpg.conf file. Press enter to continue or control+c to abort. " continue
|
||||||
fi
|
fi
|
||||||
cat << EOF > ~/.gnupg/gpg.conf
|
cat << EOF > ~/.gnupg/gpg.conf
|
||||||
@ -115,6 +115,14 @@ keyserver wwwkeys.pgp.net
|
|||||||
keyserver hkp://pool.sks-keyservers.net
|
keyserver hkp://pool.sks-keyservers.net
|
||||||
keyserver pgp.zdv.uni-mainz.de
|
keyserver pgp.zdv.uni-mainz.de
|
||||||
keyserver-options auto-key-retrieve
|
keyserver-options auto-key-retrieve
|
||||||
|
EOF
|
||||||
|
if [ -f ~/.gnupg/gpg-agent.conf ]; then
|
||||||
|
read -p "This will overwrite your existing ~/.gnupg/gpg-agent.conf file. Press enter to continue or control+c to abort. " continue
|
||||||
|
fi
|
||||||
|
cat << EOF > ~/.gnupg/gpg-agent.conf
|
||||||
|
default-cache-ttl 300
|
||||||
|
max-cache-ttl 999999
|
||||||
|
allow-loopback-pinentry
|
||||||
EOF
|
EOF
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -162,6 +170,7 @@ add_email_address()
|
|||||||
gpg -r $keyName -e "$passwordFile"
|
gpg -r $keyName -e "$passwordFile"
|
||||||
mv "$passwordFile.gpg" "$muttHome/$emailAddress.gpg"
|
mv "$passwordFile.gpg" "$muttHome/$emailAddress.gpg"
|
||||||
shred -fuzn 10 "$passwordFile"
|
shred -fuzn 10 "$passwordFile"
|
||||||
|
echo "source \"gpg -d ${muttHome/$HOME/~}${emailAddress}.gpg|\"" >> "$muttHome/$emailAddress"
|
||||||
echo "Email address added, press enter to continue."
|
echo "Email address added, press enter to continue."
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user