Skip to content

Commit

Permalink
Refs skycoin#572, adding the update script
Browse files Browse the repository at this point in the history
  • Loading branch information
stdevPavelmc committed Sep 20, 2019
1 parent 831b712 commit c3e8d6b
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions static/script/upgrade/upgrade-discovery
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#!/bin/bash

# Script to upgrade the discovery address of the actual skyminers on the testnet
# this must be run on each OrangePi Prime PC

# vars
SKYWIRE=/usr/local/skywire/go/src/github.com/skycoin/skywire/
DEFAULTS=$SKYWIRE/static/script/skywire.defaults

# get the MANAGER_IP configured
MIP=`cat $DEFAULTS | grep MANAGER_IP | grep '=' | cut -d '=' -f 2`

# stop the services prior to the upgrade
systemctl stop skywire-manager.service &> /dev/null
systemctl stop skywire-node.service &> /dev/null

# do the git upgrade
cd $SKYWIRE

# clean the env for git
git reset --hard
git clean -f -d

# pull the changes with redundancy
git pull || git pull

# reconfigure the custom MANAGER_IP
NMIP=`cat $DEFAULTS | grep MANAGER_IP | grep '=' | cut -d '=' -f 2`
if [ "$MIP" != "$NMIP" ] ; then
sed -i s/"=$NMIP"/"=$MIP"/ $DEFAULTS
fi

# finish
echo "Done, reboot the node to apply changes"
echo "Type 'reboot' then hit enter"

0 comments on commit c3e8d6b

Please sign in to comment.