updated on Sun Jan 15 20:01:04 UTC 2012
[aur-mirror.git] / bitcoin-daemon / rc.bitcoind
blobbe09251d1a1178954d1eb27702770aa2b448f46d
1 #!/bin/bash
3 . /etc/rc.conf
4 . /etc/rc.d/functions
6 case "$1" in
7 start)
8 stat_busy "Starting bitcoind"
9 su -s /bin/bash -c "nohup bitcoind -gen=0 -datadir=/var/lib/bitcoin-daemon &" bitcoin > /dev/null 2>&1
10 if [ $? -gt 0 ]; then
11 stat_fail
12 else
13 add_daemon bitcoind
14 stat_done
17 stop)
18 stat_busy "Stopping bitcoind"
19 su -s /bin/bash -c "bitcoind -datadir=/var/lib/bitcoin-daemon stop" bitcoin &> /dev/null
20 if [ $? -gt 0 ]; then
21 stat_fail
22 else
23 rm_daemon bitcoind
24 stat_done
27 restart)
28 $0 stop
29 sleep 1
30 $0 start
33 echo "usage: $0 {start|stop|restart}"
34 esac
35 exit 0