#!/bin/bash #prepare MN for updating by stopping wagerrd and removing wagerr-2.0.0 cd ~/wagerr-2.0.0/bin ./wagerr-cli stop cd ~ rm -r ~/wagerr-2.0.0 #download, unzip, and remove tar.gz for new new release wget -q https://github.com/wagerr/wagerr/releases/download/v2.0.1/wagerr-2.0.1-x86_64-linux-gnu.tar.gz tar -xvf wagerr-2.0.1-x86_64-linux-gnu.tar.gz rm wagerr-2.0.1-x86_64-linux-gnu.tar.gz #start wagerrd cd ~/wagerr-2.0.1/bin ./wagerrd & echo -e "Your Wagerr Masternode has been successfully upgraded to version 2.0.1 Monte Carlo" #start of Auto-Restart script creation read -p "Do you want to create the mn_auto script? (Y/n) " -n 1 -r echo if [[ $REPLY =~ ^[Yy]$ ]] then cd ~/wagerr-2.0.1/bin cat < mn_auto.sh #!/bin/bash SERVICE='wagerrd' if ps ax | grep -v grep | grep $SERVICE > /dev/null then echo “Masternode is running! Yay!” else ~/wagerr-2.0.1/bin/./wagerrd fi EOT chmod 744 mn_auto.sh fi read -p "Do you want to add the required cron task? (Y/n) " -n 1 -r echo if [[ $REPLY =~ ^[Yy]$ ]] then crontab -l | { cat; echo "*/15 * * * * /root/wagerr-2.0.1/bin/mn_auto.sh >> /root/wagerr-2.0.1/bin/cronlog/auto.log 2>&1 #logs output to auto.log"; } | crontab - l mkdir cronlog fi