forked from cybercongress/go-cyber
-
Notifications
You must be signed in to change notification settings - Fork 0
/
entrypoint.sh
43 lines (36 loc) · 904 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
#!/bin/sh
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 [ -f "/root/.cyber/cosmovisor/genesis/bin/cyber" ]
then
cp /cyber/cosmovisor/genesis/bin/cyber /root/.cyber/cosmovisor/genesis/bin/cyber
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