diff options
author | Mattias Andrée <maandree@kth.se> | 2021-06-25 20:44:21 +0200 |
---|---|---|
committer | Mattias Andrée <maandree@kth.se> | 2021-06-25 20:44:21 +0200 |
commit | d5fb2d47307557219a5d4814aef24d8b544f1c68 (patch) | |
tree | 320c772174104efa42f4b74c77b47e878b8a0b94 | |
parent | Fix bugs (diff) | |
download | dotfiles-d5fb2d47307557219a5d4814aef24d8b544f1c68.tar.gz dotfiles-d5fb2d47307557219a5d4814aef24d8b544f1c68.tar.bz2 dotfiles-d5fb2d47307557219a5d4814aef24d8b544f1c68.tar.xz |
Link ~/.var/lib/gnupg to ~/.dotfiles/.secrets/gnupg; also fix GNUPG_HOME in gnupg/user-profile
Signed-off-by: Mattias Andrée <maandree@kth.se>
-rw-r--r-- | gnupg/Makefile | 11 | ||||
-rw-r--r-- | gnupg/user-profile | 2 |
2 files changed, 10 insertions, 3 deletions
diff --git a/gnupg/Makefile b/gnupg/Makefile index f89880c..6583b2d 100644 --- a/gnupg/Makefile +++ b/gnupg/Makefile @@ -2,7 +2,14 @@ include ../common.mk install: - mkdir -p -- ~/.var/lib/gnupg + mkdir -p -- ~/.dotfiles/.secrets/gnupg + mkdir -p -- ~/.var/lib + if test -L ~/.var/lib/gnupg; then \ + test "$$(readlink -- ~/.var/lib/gnupg)" = ~/.dotfiles/.secrets/gnupg; \ + else \ + test ! -e ~/.var/lib/gnupg && \ + ln -s -- ~/.dotfiles/.secrets/gnupg ~/.var/lib/gnupg; \ + fi mkdir -p -- ~/.config/profile.d test ! -d ~/.config/profile.d/gnupg ln -sf -- ~/.dotfiles/gnupg/user-profile ~/.config/profile.d/gnupg @@ -10,6 +17,6 @@ install: uninstall: -unlink -- ~/.config/profile.d/gnupg -rmdir -- ~/.config/profile.d - -rmdir -- ~/.var/lib/gnupg + -unlink -- ~/.var/lib/gnupg .PHONY: install uninstall diff --git a/gnupg/user-profile b/gnupg/user-profile index 67cbb86..3736519 100644 --- a/gnupg/user-profile +++ b/gnupg/user-profile @@ -1,6 +1,6 @@ # -*- shell-script -*- -export GNUPGHOME=~/.var/lib/.gnupg +export GNUPGHOME=~/.var/lib/gnupg export GPG_KEY=69E7C5ED export GPG_KEYA=45668AAD |