aboutsummaryrefslogtreecommitdiff
path: root/bin/gpg-wrapper
diff options
context:
space:
mode:
authorRyan Kavanagh <ryanakca@kubuntu.org>2011-08-14 17:16:55 -0400
committerRyan Kavanagh <ryanakca@kubuntu.org>2011-08-25 07:42:57 -0400
commit1c019761dfaf6be82de9284fa5e2b9dbfbdec27d (patch)
tree7ed6bd2f437d3a334bd7a81f62e6dfa63689272b /bin/gpg-wrapper
Initial import
Diffstat (limited to 'bin/gpg-wrapper')
-rwxr-xr-xbin/gpg-wrapper41
1 files changed, 41 insertions, 0 deletions
diff --git a/bin/gpg-wrapper b/bin/gpg-wrapper
new file mode 100755
index 0000000..628f618
--- /dev/null
+++ b/bin/gpg-wrapper
@@ -0,0 +1,41 @@
+#!/bin/zsh
+# gpg-wrapper for users who put their .gnupg on a LUKS (encrypted) device
+# Copyright (C) 2009 Ryan Kavanagh <ryanakca@kubuntu.org>
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+
+mount_point='/media/encrypted'
+gpg_path='/usr/bin/gpg'
+gnupg_dir=${mount_point}/.gnupg/
+
+# Is there a .gnupg dir on $mount_point? If so, we ought to tell gpg to use
+# $mount_point/.gnupg, just in case the user didn't setup symlinks from
+# $HOME/.gnupg/ pointing to $mount_point/.gnupg
+if [ -d ${gnupg_dir} ]
+then
+ exec $gpg_path --homedir $gnupg_dir $@
+
+else
+ gpg-mounter
+ if [ -d ${gnupg_dir} ]
+ then
+ exec $gpg_path --homedir $gnupg_dir $@
+ else
+ echo 'No .gnupg dir in $mount_point'
+ exit 1
+ fi
+fi
+
+exit 0