aboutsummaryrefslogtreecommitdiff
path: root/contrib/debian/bin
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/debian/bin')
-rwxr-xr-xcontrib/debian/bin/bitcoin-qt16
-rwxr-xr-xcontrib/debian/bin/bitcoind18
2 files changed, 34 insertions, 0 deletions
diff --git a/contrib/debian/bin/bitcoin-qt b/contrib/debian/bin/bitcoin-qt
new file mode 100755
index 0000000000..f2eac1b1ab
--- /dev/null
+++ b/contrib/debian/bin/bitcoin-qt
@@ -0,0 +1,16 @@
+#!/bin/sh
+
+set -e
+
+umask 077
+
+basedir=~/.bitcoin
+dbfile="$basedir/DB_CONFIG"
+cfgfile="$basedir/bitcoin.conf"
+
+[ -e "$basedir" ] || mkdir "$basedir"
+
+# Bitcoin does not clean up DB log files by default
+[ -e "$dbfile" ] || echo 'set_flags DB_LOG_AUTOREMOVE' > "$dbfile"
+
+exec /usr/lib/bitcoin/bitcoin-qt "$@"
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 "$@"