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