-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstart-keychain
28 lines (21 loc) · 883 Bytes
/
start-keychain
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# Source this file to start keychain
# First make sure charade is still in place,
# as it might be overwritten by cygwin updates
unset hashes
declare -A hashes
hashes[triace]=603289f824a3a86fd900f8a80e8ab83f54c5fbfb337c587471698af1b195b688
hashes[LBNL07919]=44e7880860efed85cc2ff0fea75b429935e14beff29933f10eb8fd2ec36dc64f
if [ ! ${hashes[$(hostname)]+abc} ]; then
echo "Hostname not found in expected hashes. Please update ${BASH_SOURCE[0]} with"
echo "hashes[$(hostname)]=$(sha256sum /usr/bin/ssh-agent|sed 's/^\([0-9a-f]\+\).*/\1/')"
return
fi
echo ${hashes[$(hostname)]} expected hash
sha256sum.exe /usr/bin/ssh-agent | egrep "^${hashes[$(hostname)]} \*/usr/bin/ssh-agent"
if [ ! $? -eq 0 ]; then
echo -ne "/usr/bin/ssh-agent hash invalid\nreinstall charade:\n\$ cd ~/src/charade\n\$ make install"
return
fi
unset hashes
keychain -Q
source ~/.keychain/`hostname`-sh