-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathdash-masternode.sh
More file actions
47 lines (34 loc) · 976 Bytes
/
dash-masternode.sh
File metadata and controls
47 lines (34 loc) · 976 Bytes
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
#!/bin/bash
CONF=/root/.dashcore/dash.conf
# if envirment viaribles exist
if [ ! -z ${MN_PRIVATE_KEY+x} ]; then
# TODO issue warning if dash.conf already exist
# overwrite dash.conf
cp -f ./dash-default.conf $CONF
RPCUSER=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1)
RPCPASSWD=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1)
echo "rpcuser=$RPCUSER" >> $CONF
echo "rpcpassword=$RPCPASSWD" >> $CONF
echo "masternodeprivkey=$MN_PRIVATE_KEY" >> $CONF
if [ ! -z "$MN_EXTERNAL_IP" ]; then
echo "externalip=$MN_EXTERNAL_IP" >> $CONF
fi
if [ -z "$MN_RPCBIND" ]; then
echo "rpcbind=127.0.0.1" >> $CONF
else
echo "rpcbind=$MN_RPCBIND" >> $CONF
fi
if [ -z "$MN_RPCALLOWIP" ]; then
echo "rpcallowip=127.0.0.1" >> $CONF
else
echo "rpcallowip=$MN_RPCALLOWIP" >> $CONF
fi
fi
# start dashd
/dashd
# start sentinel loop
while :
do
python sentinel/bin/sentinel.py
sleep 300
done