forked from nbd-wtf/bitcoin_signet
-
Notifications
You must be signed in to change notification settings - Fork 23
Expand file tree
/
Copy pathdocker-entrypoint.sh
More file actions
executable file
·34 lines (30 loc) · 937 Bytes
/
docker-entrypoint.sh
File metadata and controls
executable file
·34 lines (30 loc) · 937 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
#!/bin/bash
set -eo pipefail
shutdown_gracefully(){
echo "Container is shutting down, lets make sure bitcoind flushes the db."
bitcoin-cli stop
sleep 5
}
trap shutdown_gracefully SIGTERM SIGHUP SIGQUIT SIGINT
mkdir -p "${BITCOIN_DIR}"
# check if this is first run if so run init if config
if [[ ! -f "${BITCOIN_DIR}/install_done" ]]; then
echo "install_done file not found, running install.sh."
install.sh #this is config based on args passed into mining node or peer.
else
echo "install_done file exists, skipping setup process."
if [[ ! -f "${BITCOIN_DIR}/uses_modern_wallet" ]]; then
echo "Hmm looks like you are using a legacy wallet, lets get that migrated over."
migrate.sh
sleep 4
echo "Migration complete, lets start bitcoind."
fi
echo "rewrite bitcoin.conf"
gen-bitcoind-conf.sh >~/.bitcoin/bitcoin.conf
fi
$@ &
echo "Infinite loop"
while true
do
tail -f /dev/null & wait ${!}
done