aboutsummaryrefslogtreecommitdiff
path: root/kshrc
diff options
context:
space:
mode:
Diffstat (limited to 'kshrc')
-rw-r--r--kshrc10
1 files changed, 8 insertions, 2 deletions
diff --git a/kshrc b/kshrc
index 9a6f773..429664a 100644
--- a/kshrc
+++ b/kshrc
@@ -401,13 +401,19 @@ gitdateUnset() {
}
gpgTmpDir() {
+ __privdir='/dev/shm'
+ if [ "$(uname)" != "Linux" ] ; then
+ echo "Warning /tmp may not be a ramdisk"
+ __privdir="/tmp"
+ fi
+
set -x
- if echo "$GNUPGHOME" | grep -q "/dev/shm/"; then
+ if echo "$GNUPGHOME" | grep -q "$__privdir"; then
rm -rvf "$GNUPGHOME"
fi
#shellcheck disable=SC2155
- export GNUPGHOME="$(mktemp -d /dev/shm/GPG.XXXXXX)"
+ export GNUPGHOME="$(mktemp -d "$__privdir"/GPG.XXXXXX)"
set +x
}