#!/bin/sh
echo "########### This script will update the Master Node"
sleep 5
VERSION=64
URL=$1
FILE=${URL##*/}
DIR=${FILE%.tar.gz}
IP=$(hostname -I)
wget $URL
tar xzvf $FILE
echo "########### Stopping the Master Node"
./darkcoind stop
sleep 7
rm darkcoind
cp $DIR/bin/$VERSION/darkcoind .
chmod 755 darkcoind
rm $FILE
rm -rf $DIR
rm .darkcoin/peers.dat
echo "########### Restarting the updated Master Node"
sleep 5
./darkcoind
sleep 15
./darkcoind getinfo
sleep 5
echo "########### Master Node status - Active: 1, Inctive: 0"
./darkcoind masternode list | grep $IP
Oh, contrariwise; you most absolutely must without exception, always. The new daemon will not know it is an MN in spite of there being such in the config. Without a "masternode start" it will just sit there, never ping the network, become inactive, then drop off the list entirely, and when using start-many, that's a pain to deal with... Ask me how I know this......you generally do not have to execute the masternode start command on the remote machine.
#!/bin/bash
GETURL=https://raw.githubusercontent.com/darkcoinproject/darkcoin-binaries/master/
if [ -z $1 ] ; then
echo "usage: $0 darkcoinversion"
echo "eg: $0 0.10.16.16"
exit
fi
version=$1
GETFILE=darkcoin-${version}-linux.tar.gz
GETURL=${GETURL}${GETFILE}
if [ ! -e $GETFILE ] ; then
wget $GETURL
fi
if [ ! -e $GETFILE ] ; then
echo "error downloading file"
echo "tried to get ${GETURL}"
exit
fi
#unpack it
tar zxvf $GETFILE
#copy it
cp darkcoin-${version}-linux/bin/64/darkcoind ~/.darkcoin/darkcoind-${version}
#remove unneeded
rm -rf darkcoin-${version}-linux
#work it
cd ~/.darkcoin
#stop it
darkcoind stop
#wait it
sleep 5
#clean it
rm -f debug.log peers.dat
#link it
rm darkcoind && ln -s darkcoind-${version} darkcoind
#start it
./darkcoind &
#!/bin/bash
date
if [ $1 ]; then
DARK=darkcoin-$1-linux
wget https://github.com/darkcoinproject/darkcoin-binaries/raw/master/$DARK.tar.gz
tar -xvf $DARK.tar.gz
chmod u+x $DARK/bin/64/darkcoind
else
cd ~/darkcoin/
git pull
cd src/
make -f makefile.unix USE_UPNP=-
fi
darkcoind stop
sleep 5
mv /usr/bin/darkcoind /usr/bin/darkcoind.old
if [ $1 ]; then
mv $DARK/bin/64/darkcoind /usr/bin/
rm -r $DARK*
else
cp darkcoind /usr/bin/
fi
darkcoind
./mn_update.sh 0.10.16.16
./mn_update.sh
Hi,
I have not seen any masternode update script, so I want to share my simple one.
This is for local-remote setup. This script should be run on the remote server for masternode update. You only have to restart masternode on the local machine, when there was a protocol version update.
If you have more than one masternode/server, you can use "superputty" to execute the update command simultaneous on all remote machines: https://code.google.com/p/superputty/
you need to add the url for the new darkcoin (tar.gz compressed) binary as argument e. g. "sh update.sh https://www.dashpay.io/binaries/dash-0.11.1.26-linux.tar.gz"Code:#!/bin/sh echo "########### This script will update the Master Node" sleep 5 VERSION=64 URL=$1 FILE=${URL##*/} DIR=${FILE%.tar.gz} cd ~/.dash wget $URL tar xzvf $FILE echo "########### Stopping the Master Node" ./dashd stop sleep 4 rm dashd cp $DIR/bin/$VERSION/dashd . chmod 755 dashd rm $FILE rm -rf $DIR rm peers.dat debug.log db.log echo "########### Restarting the updated Master Node" sleep 2 ./dashd
place the code inside ~/.dash/update.sh and chmod 755 update.sh
for it to work you need a symbolic link from /usr/bin/dashd to ~/.dash/dashd: "sudo ln -s ~/.dash/dashd /usr/bin/"
cheers,
EDIT: added status message output and "rm peers.dat debug.log db.log" command (thanks DrkMiner)
EDIT2: added superputty advice (thanks oblox)
EDIT3: updated for new name "dash"
but I just did that! what do you mean exactly?
For all you folks running version 12 on linux:
https://github.com/moocowmoo/dashman
(Read the README, this script places the executables in ~/.dash -- I'll add destination folders eventually.)
Let me know if you run into any trouble. I'll push bugfixes as we find them.
(32bit install untested, but should work, lmk)
HiI have updated the script but it requires 'bash'
it's a bit of a hacky way so I'm open to how to improve it (I'm not a programmer)
For upgrading to v12.
#!/bin/bash
echo "########### This script will update the Master Node"
sleep 5
URL=$1
FILE=${URL##*/}
DIR=${FILE:0:11}
cd ~/.dash
wget $URL
tar xzvf $FILE
echo "########### Stopping the Master Node"
./dashd stop
sleep 5
rm dashd
cp $DIR/bin/dashd .
cp $DIR/bin/dash-cli .
chmod 755 dashd
rm $FILE
rm -rf $DIR
rm peers.dat debug.log db.log
echo "########### Restarting the updated Master Node"
sleep 2
./dashd -reindex
Once on v12 and future updates (provided no more changes in directory structure)
#!/bin/bash
echo "########### This script will update the Master Node"
sleep 5
URL=$1
FILE=${URL##*/}
DIR=${FILE:0:11}
cd ~/.dash
wget $URL
tar xzvf $FILE
echo "########### Stopping the Master Node"
./dash-cli stop
sleep 5
rm dashd
cp $DIR/bin/dashd .
cp $DIR/bin/dash-cli .
chmod 755 dashd
rm $FILE
rm -rf $DIR
rm peers.dat debug.log db.log
echo "########### Restarting the updated Master Node"
sleep 2
./dashd
Please tell me about work on Ubuntu?