Commit 14311384fad4bba30e32a2bbe8657ee256e9d89d

Authored by Georg Hopp
1 parent 2d85102c

changes for zsh and new system

Showing 2 changed files with 10 additions and 10 deletions
@@ -13,7 +13,7 @@ function insert_keypair() { @@ -13,7 +13,7 @@ function insert_keypair() {
13 local DATASIG="$(/bin/sed '1p;d' "${HOME}/.ecryptfs/${2}.sig")" 13 local DATASIG="$(/bin/sed '1p;d' "${HOME}/.ecryptfs/${2}.sig")"
14 local NAMESIG="$(/bin/sed '2p;d' "${HOME}/.ecryptfs/${2}.sig")" 14 local NAMESIG="$(/bin/sed '2p;d' "${HOME}/.ecryptfs/${2}.sig")"
15 local DPF="${2}-passphrase" 15 local DPF="${2}-passphrase"
16 - local NPF="${DPF}-fname" 16 + local NPF="${2}-fname-passphrase"
17 17
18 insert_key "${1}/${DPF}" "${HOME}/.ecryptfs/wrapped-${DPF}" "${DATASIG}" 18 insert_key "${1}/${DPF}" "${HOME}/.ecryptfs/wrapped-${DPF}" "${DATASIG}"
19 insert_key "${1}/${NPF}" "${HOME}/.ecryptfs/wrapped-${NPF}" "${NAMESIG}" 19 insert_key "${1}/${NPF}" "${HOME}/.ecryptfs/wrapped-${NPF}" "${NAMESIG}"
@@ -21,7 +21,7 @@ function ssh-add() { @@ -21,7 +21,7 @@ function ssh-add() {
21 local ident="${1}" 21 local ident="${1}"
22 local ask_pass ident_file 22 local ask_pass ident_file
23 23
24 - if [ "${ident}" ] 24 + if [[ "${ident}" ]]
25 then 25 then
26 ask_pass="${HOME}/.ssh/getcred_${ident}.sh" 26 ask_pass="${HOME}/.ssh/getcred_${ident}.sh"
27 ident_file="${HOME}/.ssh/ident-${ident}" 27 ident_file="${HOME}/.ssh/ident-${ident}"
@@ -30,7 +30,7 @@ function ssh-add() { @@ -30,7 +30,7 @@ function ssh-add() {
30 ident_file="${HOME}/.ssh/ident" 30 ident_file="${HOME}/.ssh/ident"
31 fi 31 fi
32 32
33 - if [ '-' != "${ident:0:1}" ] 33 + if [[ '-' != "${ident:0:1}" ]]
34 then 34 then
35 DISPLAY=:0.0 SSH_ASKPASS="${ask_pass}" \ 35 DISPLAY=:0.0 SSH_ASKPASS="${ask_pass}" \
36 ${SSH_ADD} ${ident_file} 2>/dev/null </dev/null 36 ${SSH_ADD} ${ident_file} 2>/dev/null </dev/null
@@ -45,11 +45,11 @@ function ssh-init-agent() { @@ -45,11 +45,11 @@ function ssh-init-agent() {
45 local ECHO="/bin/echo" 45 local ECHO="/bin/echo"
46 local SSH_AGENT="/usr/bin/ssh-agent" 46 local SSH_AGENT="/usr/bin/ssh-agent"
47 47
48 - test -e "${SSH_AGENT_FILE}" && eval `${CAT} "${SSH_AGENT_FILE}"` >/dev/null 48 + [[ -e "${SSH_AGENT_FILE}" ]] && eval `${CAT} "${SSH_AGENT_FILE}"` >/dev/null
49 49
50 - if [ "x" != x${SSH_AGENT_PID} ] 50 + if [[ "x" != x${SSH_AGENT_PID} ]]
51 then 51 then
52 - if [ "ssh-agent" = "`${PS} -p ${SSH_AGENT_PID} -o comm=`" ] 52 + if [[ "ssh-agent" = "`${PS} -p ${SSH_AGENT_PID} -o comm=`" ]]
53 then 53 then
54 return 54 return
55 fi 55 fi
@@ -57,7 +57,7 @@ function ssh-init-agent() { @@ -57,7 +57,7 @@ function ssh-init-agent() {
57 57
58 ${ECHO} -n "start ssh-agent ... " 58 ${ECHO} -n "start ssh-agent ... "
59 ${SSH_AGENT} >"${SSH_AGENT_FILE}" 59 ${SSH_AGENT} >"${SSH_AGENT_FILE}"
60 - if [ 0 -eq $? ] 60 + if [[ 0 -eq $? ]]
61 then 61 then
62 eval `${CAT} "${SSH_AGENT_FILE}"` >/dev/null 62 eval `${CAT} "${SSH_AGENT_FILE}"` >/dev/null
63 ${ECHO} "OK" 63 ${ECHO} "OK"
@@ -89,13 +89,13 @@ function gpg-init-agent() { @@ -89,13 +89,13 @@ function gpg-init-agent() {
89 GPG_AGENT_PID="$(${PS} -h -U ${USER} -o pid -o comm |\ 89 GPG_AGENT_PID="$(${PS} -h -U ${USER} -o pid -o comm |\
90 ${AWK} '/gpg-agent/{print $1}')" 90 ${AWK} '/gpg-agent/{print $1}')"
91 91
92 - if [ "${SOCK_OPEN_PID}" -a "${GPG_AGENT_PID}" = "${SOCK_OPEN_PID}" ] 92 + if [[ "${SOCK_OPEN_PID}" && ${GPG_AGENT_PID} == ${SOCK_OPEN_PID} ]]
93 then 93 then
94 return 94 return
95 else 95 else
96 ${ECHO} -n "start gpg-agent ... " 96 ${ECHO} -n "start gpg-agent ... "
97 - ${GPG_AGENT} ${GPG_AGENT_ARGS}  
98 - if [ 0 -eq $? ] 97 + eval ${GPG_AGENT} ${GPG_AGENT_ARGS}
  98 + if [[ 0 -eq $? ]]
99 then 99 then
100 ${CAT} "${CREDDIR}/gpg.pw" | ${GPG_PRESET} --preset ${KEYGRIP} 100 ${CAT} "${CREDDIR}/gpg.pw" | ${GPG_PRESET} --preset ${KEYGRIP}
101 ${CAT} "${CREDDIR}/gpg.pw" | ${GPG_PRESET} --preset ${SUBKEYGRIP} 101 ${CAT} "${CREDDIR}/gpg.pw" | ${GPG_PRESET} --preset ${SUBKEYGRIP}
Please register or login to post a comment