aboutsummaryrefslogtreecommitdiff
path: root/contrib/debian/bin/bitcoind
blob: 0904f76f7be5dc37d0d3ecfeeb9d2db2d77b0dec (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/bin/sh

set -e

umask 077

basedir=~/.bitcoin
dbfile="$basedir/DB_CONFIG"
cfgfile="$basedir/bitcoin.conf"

[ -e "$basedir" ] || mkdir "$basedir"

[ -e "$cfgfile" ] || perl -le 'print"rpcpassword=",map{(a..z,A..Z,0..9)[rand 62]}0..9' > "$cfgfile"

# Bitcoin does not clean up DB log files by default
[ -e "$dbfile" ] || echo 'set_flags DB_LOG_AUTOREMOVE' > "$dbfile"

exec /usr/lib/bitcoin/bitcoind "$@"