-
Notifications
You must be signed in to change notification settings - Fork 87
/
entrypoint.sh
45 lines (37 loc) · 955 Bytes
/
entrypoint.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
#!/bin/sh
ln -s /root/.cyber/cosmovisor/current/bin/cyber /usr/bin/cyber
if [ ! -d "/root/.cyber/" ]
then
mkdir /root/.cyber/
mkdir /root/.cyber/config/
/cyber/cosmovisor/genesis/bin/cyber init ${NODE_MONIKER}
cp -r /cyber/cosmovisor/ /root/.cyber
fi
if [ ! -f "/root/.cyber/config/node_key.json" ]
then
/cyber/cosmovisor/genesis/bin/cyber init ${NODE_MONIKER}
cp /genesis.json /root/.cyber/config/
cp -r /cyber/cosmovisor/ /root/.cyber
fi
if [ ! -d "/root/.cyber/cosmovisor" ]
then
cp -r /cyber/cosmovisor/ /root/.cyber/
fi
if [ ! -d "/root/.cyber/cosmovisor/updgrades" ]
then
cp -r /cyber/cosmovisor/upgrades /root/.cyber/cosmovisor/
fi
if [ ! -d "/root/.cyber/cosmovisor/upgrades/v4/" ]
then
cp -r /cyber/cosmovisor/upgrades/v4 /root/.cyber/cosmovisor/upgrades/v4
fi
if [ ! -f "/root/.cyber/config/genesis.json" ]
then
cp /genesis.json /root/.cyber/config/
fi
if [ "$2" = 'init' ]
then
return 0
else
exec "$@"
fi