Unnamed Fossil Project

Check-in [50207cdf4d]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:shell: Improve GPG key loading with perl one-liner
Timelines: family | ancestors | trunk
Files: files | file ages | folders
SHA1:50207cdf4d0e9fef3db86656e54f683f16602795
User & Date: necrophcodr 2015-12-28 15:06:59
Context
2015-12-28
15:06
shell: Improve GPG key loading with perl one-liner Leaf check-in: 50207cdf4d user: necrophcodr tags: trunk
2015-11-15
11:54
shell: Fix zprezto cloning. check-in: 3dcfeb3353 user: necrophcodr tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to shell/.zshrc.

31
32
33
34
35
36
37

38
39
40
41
42
43

if [ "x$(tty | grep -E '\/dev\/tty[0-9]')" = "x" ]; then
	# This is a terminal emulator, not a virtual terminal.
	if [ "$(which keychain 2>/dev/null >/dev/null; echo $?)" = "0" ]; then
		GPG_TTY=`tty`
		export GPG_TTY
		SSH_PRIVKEYS=$(ls ~/.ssh/ | grep -E '^id_.*[^.pub]$')

		eval `keychain --eval --agents gpg,ssh ${SSH_PRIVKEYS} FA697FA1`
	fi
fi


export SVDIR LANG LC_ALL







>
|





31
32
33
34
35
36
37
38
39
40
41
42
43
44

if [ "x$(tty | grep -E '\/dev\/tty[0-9]')" = "x" ]; then
	# This is a terminal emulator, not a virtual terminal.
	if [ "$(which keychain 2>/dev/null >/dev/null; echo $?)" = "0" ]; then
		GPG_TTY=`tty`
		export GPG_TTY
		SSH_PRIVKEYS=$(ls ~/.ssh/ | grep -E '^id_.*[^.pub]$')
		GPG_PRIVKEYS=$(gpg --list-secret-keys | perl -e 'while(<STDIN>) { m/^sec[\s]+.+\/([^\s]+).+$/g; next unless pos; print "$1\n" if $1; }')
		eval `keychain --eval --agents gpg,ssh ${SSH_PRIVKEYS} ${GPG_PRIVKEYS}`
	fi
fi


export SVDIR LANG LC_ALL