-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstart.sh
70 lines (44 loc) · 1.25 KB
/
start.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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
#!/usr/bin/env bash
FILE=/app/idena/idena-node
if [ -f "$FILE" ]; then
echo "$FILE on"
else
wget -O /app/idena/idena-node https://github.com/idena-network/idena-go/releases/download/v${VER}/idena-node-linux-${VER}
echo "$FILE set"
fi
FILE=/app/idena/datadir/idenachain.db/LOG
if [ -f "$FILE" ]; then
echo "$FILE on"
else
wget -O idenachain.db.zip https://sync.idena.site/idenachain.db.zip
unzip /app/idena/idenachain.db.zip -d /app/idena/datadir/idenachain.db/
echo "$FILE set"
rm /app/idena/idenachain.db.zip
fi
FILE=/app/idena/datadir/keystore
if [ -f "$FILE" ]; then
echo "$FILE on "
else
mkdir datadir/keystore
echo "$FILE create "
fi
FILE=/app/idena/datadir/api.key
if [ -f "$FILE" ]; then
echo "$FILE on "
else
touch datadir/api.key
echo "$FILE set "
fi
if [ -z "$NODE_KEY" ]
then
echo "The variable NODE has nothing in it."\
elif ! [ -z "$NODE_KEY" ]
then
touch datadir/keystore/nodekey
echo ${NODE_KEY} > datadir/keystore/nodekey
echo "The variable NODE has something in it."
fi
echo ${API_KEY} > datadir/api.key
echo ${CONF} | sed -e "s/^.//;s/.$//" > /app/idena/config.json
chmod +x /app/idena/idena-node
/app/idena/idena-node --config /app/idena/config.json