From 17e1cc86991d0dec82098ddb63c9cc5de0067766 Mon Sep 17 00:00:00 2001 From: Frank Villaro-Dixon Date: Sun, 18 Aug 2013 13:53:13 +0200 Subject: [PATCH] auto unlock pass for mutt --- install.sh | 1 + mutt/muttrc | 3 ++- mutt/unlock-pass.sh | 11 +++++++++++ 3 files changed, 14 insertions(+), 1 deletion(-) create mode 100755 mutt/unlock-pass.sh diff --git a/install.sh b/install.sh index d92260a..f8a65ae 100755 --- a/install.sh +++ b/install.sh @@ -29,6 +29,7 @@ ln -s $WAI/mutt/passwords.gpg ./ ln -s $WAI/mutt/crypto ./ ln -s $WAI/mutt/colors.test1 ./ ln -s $WAI/mutt/colors.test2 ./ +ln -s $WAI/mutt/unlock-pass.sh ./ #VIM diff --git a/mutt/muttrc b/mutt/muttrc index 0b7207f..873ee88 100644 --- a/mutt/muttrc +++ b/mutt/muttrc @@ -18,7 +18,8 @@ set from = "Frank@Villaro-Dixon.eu" set realname = "Frank Villaro-Dixon" ##Passwords: -source "gpg -d ~/.mutt/passwords.gpg |" +####source "gpg -d ~/.mutt/passwords.gpg |" +source "~/.mutt/unlock-pass.sh |" # Change the following line to a different editor you prefer. #set editor = "vim" diff --git a/mutt/unlock-pass.sh b/mutt/unlock-pass.sh new file mode 100755 index 0000000..48bb3fb --- /dev/null +++ b/mutt/unlock-pass.sh @@ -0,0 +1,11 @@ +#!/bin/bash + +PASS_FILE="/dev/shm/$USER-mutt-pass" +ENC_PASS_FILE=~/.mutt/passwords.gpg + +if [ ! -e $PASS_FILE ]; then + umask 077 + gpg -d $ENC_PASS_FILE > $PASS_FILE +fi + +cat $PASS_FILE