summaryrefslogtreecommitdiff
path: root/social/bitcoin-daemon/bitcoin-daemon.install
blob: 2eea98e2c51463ff081209c713a26430d87abf4d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
post_install() {
	echo "==> Creating the bitcoin user…"
	groupadd -g 8333 bitcoin
	useradd -d /var/lib/bitcoin-daemon -g 8333 -u 8333 -s /bin/false -N bitcoin
	pw="$RANDOM$RANDOM$RANDOM"
	echo "==> Setting the default RPC password to $pw"
	echo "rpcpassword=$pw" >> /var/lib/bitcoin-daemon/bitcoin.conf
	chown 8333:8333 /var/lib/bitcoin-daemon/bitcoin.conf
	chmod 400 /var/lib/bitcoin-daemon/bitcoin.conf
	echo "==> You can add bitcoind to your DAEMONS array in rc.conf."
}

post_remove() {
	echo "==> Deleting the bitcoin user…"
	groupdel bitcoin
	userdel bitcoin
	echo "==> Your configuration file and wallet is still in /opt/bitcoin-daemon."
}