forked from skycoin/skywire-testnet
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refs skycoin#572, adding the update script
- Loading branch information
1 parent
831b712
commit c3e8d6b
Showing
1 changed file
with
36 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" | ||
|