1
Русский (Russian) / Re: Экспорт PTS в BitShares
« on: March 13, 2015, 02:45:01 am »
Спасибо! Чтобы не засорять тему - ответил в PM.
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
nano /opt/memorycoin.sh
#!/bin/bash
APP_NAME=bitcoind
LISTEN=1925
INIT_SCRIPT="/root/memorycoin/src/bitcoind"
CONFIG_DIR="/root/.memorycoin/"
PID=`ps ax |grep "$APP_NAME --daemon" |grep -v grep |awk '{print $1}'`
ENABLED=1
TIMEOUT=30
test "$ENABLED" != "0" || exit 0
function testnetcat() {
/bin/netcat -w 10 -z 127.0.0.1 $LISTEN
}
if [ "x$PID" == "x" ]
then
$INIT_SCRIPT --daemon
exit $RETVAL
else
testnetcat
RETVAL=$?
if [ "$RETVAL" == "0" ]
then
exit $RETVAL
else
sleep $TIMEOUT
testnetcat
RETVAL=$?
if [ "$RETVAL" == "0" ]
then
exit $RETVAL
else
killall -9 $PID
sleep 5
rm -rf $CONFIG_DIR/blocks
rm -rf $CONFIG_DIR/chainstate
rm -rf $CONFIG_DIR/database
rm -rf $CONFIG_DIR/*log
rm -rf $CONFIG_DIR/.lock
rm -rf $CONFIG_DIR/*pid
$INIT_SCRIPT --daemon
exit $RETVAL
fi
fi
fi
#!/bin/bash
APP_NAME=bitcoind
LISTEN=1925
INIT_SCRIPT="/root/memorycoin/src/bitcoind"
CONFIG_DIR="/root/.memorycoin/"
PID=`ps ax |grep "$APP_NAME --daemon" |grep -v grep |awk '{print $1}'`
ENABLED=1
TIMEOUT=30
test "$ENABLED" != "0" || exit 0
killall -9 $PID
sleep 5
rm -rf $CONFIG_DIR/blocks
rm -rf $CONFIG_DIR/chainstate
rm -rf $CONFIG_DIR/database
rm -rf $CONFIG_DIR/*log
rm -rf $CONFIG_DIR/.lock
rm -rf $CONFIG_DIR/*pid
$INIT_SCRIPT --daemon
for standalone/manual repair after crash.