updated on Fri Jan 20 00:01:56 UTC 2012
[aur-mirror.git] / bitcoin-daemon / bitcoin-daemon.install
blob5b2ffec92af0638ef02acbe3c2c26ad2d697999f
1 post_install() {
2         echo "==> Creating the bitcoin user…"
3         groupadd -g 8333 bitcoin
4         useradd -d /var/lib/bitcoin-daemon -g 8333 -u 8333 -s /bin/false -N bitcoin
6         pw="$RANDOM$RANDOM$RANDOM"
7         echo "==> Setting the default RPC password to $pw"
8         echo "rpcpassword=$pw" >> /var/lib/bitcoin-daemon/bitcoin.conf
10         chown 8333:8333 /var/lib/bitcoin-daemon/bitcoin.conf
11         chmod 400 /var/lib/bitcoin-daemon/bitcoin.conf
12         echo "==> You can add bitcoind to your DAEMONS array in rc.conf."
15 post_remove() {
16         echo "==> Deleting the bitcoin user…"
17         groupdel bitcoin
18         userdel bitcoin
19         echo "==> Your configuration file and wallet is still in /opt/bitcoin-daemon."