summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Cady <d@jerkface.net>2020-09-21 11:24:56 -0400
committerAndrew Cady <d@jerkface.net>2020-09-21 11:24:56 -0400
commitc561d85cdbf2b94b1e45f2d58d1f341442038621 (patch)
treecea84c44b9d79951f33cd626383e76dea35a4717
parent32f440558a0034562088debfc2ff615db21fd459 (diff)
cryptonomic gpg: set GNUPGHOME
-rw-r--r--selfpublish.sh10
1 files changed, 10 insertions, 0 deletions
diff --git a/selfpublish.sh b/selfpublish.sh
index c11eb8f..6ebf36b 100644
--- a/selfpublish.sh
+++ b/selfpublish.sh
@@ -187,6 +187,11 @@ verbose()
187 "$@" 187 "$@"
188 fi 188 fi
189} 189}
190get_home()
191{
192 [ "$1" ] && getent passwd "$1" | (IFS=: read _ _ _ _ _ h _; echo $h)
193}
194
190 195
191set -e 196set -e
192 197
@@ -198,6 +203,11 @@ username=$(id -un)
198uid=${username}@${cryptonomic_hostname} 203uid=${username}@${cryptonomic_hostname}
199 204
200# 2. CHECK IF EXISTING SECRET KEY 205# 2. CHECK IF EXISTING SECRET KEY
206if [ "$SUDO_USER" -a ! "$GNUPGHOME" ]
207then
208 GNUPGHOME=$(get_home "$SUDO_USER")/.gnupg
209 export GNUPGHOME
210fi
201t=$(gpg -K --with-colons) 211t=$(gpg -K --with-colons)
202if [ "$t" ] 212if [ "$t" ]
203then 213then