-
Notifications
You must be signed in to change notification settings - Fork 28
/
namerd.sh
executable file
·51 lines (40 loc) · 990 Bytes
/
namerd.sh
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#!/bin/sh
set -e
version="1.0.2"
bin="target/namerd-${version}-exec"
sha="338428a49cbe5f395c01a62e06b23fa492a7a9f89a510ae227b46c915b07569e"
url="https://github.com/linkerd/linkerd/releases/download/${version}/namerd-${version}-exec"
validbin() {
checksum=$(openssl dgst -sha256 $bin | awk '{ print $2 }')
[ "$checksum" = $sha ]
}
if [ -f "$bin" ] && ! validbin ; then
echo "bad $bin" >&2
mv "$bin" "${bin}.bad"
fi
if [ ! -f "$bin" ]; then
echo "downloading $bin" >&2
curl -L --silent --fail -o "$bin" "$url"
chmod 755 "$bin"
fi
if ! validbin ; then
echo "bad $bin. delete $bin and run $0 again." >&2
exit 1
fi
mkdir -p ./tmp.discovery
if [ ! -f ./tmp.discovery/default ]; then
echo "127.1 9991" > ./tmp.discovery/default
fi
"$bin" -- - <<EOF
admin:
port: 9991
namers:
- kind: io.l5d.fs
rootDir: ./tmp.discovery
storage:
kind: io.l5d.inMemory
namespaces:
default: /svc => /#/io.l5d.fs;
interfaces:
- kind: io.l5d.httpController
EOF