aboutsummaryrefslogtreecommitdiff
path: root/contrib/debian/bin/bitcoind
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/debian/bin/bitcoind')
-rwxr-xr-xcontrib/debian/bin/bitcoind18
1 files changed, 18 insertions, 0 deletions
diff --git a/contrib/debian/bin/bitcoind b/contrib/debian/bin/bitcoind
new file mode 100755
index 0000000000..0904f76f7b
--- /dev/null
+++ b/contrib/debian/bin/bitcoind
@@ -0,0 +1,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 "$@"