mirror of
https://github.com/mynodebtc/mynode.git
synced 2025-01-11 11:29:27 +00:00
Improve upgrade consistency; Don't fail if tor is down
This commit is contained in:
parent
1b6e77a4d5
commit
d36fc0f7ed
|
@ -28,13 +28,18 @@ mkdir -p /home/admin/upgrade_logs/
|
|||
|
||||
# Download Latest
|
||||
if [ $BETA = 0 ]; then
|
||||
torify wget $UPGRADE_DOWNLOAD_URL -O /opt/mynode_release_latest.tar.gz
|
||||
torify wget $UPGRADE_DOWNLOAD_SIGNATURE_URL -O /opt/mynode_release_latest.sha256
|
||||
torify wget $UPGRADE_DOWNLOAD_URL -O /opt/mynode_release_latest.tar.gz || \
|
||||
wget $UPGRADE_DOWNLOAD_URL -O /opt/mynode_release_latest.tar.gz
|
||||
torify wget $UPGRADE_DOWNLOAD_SIGNATURE_URL -O /opt/mynode_release_latest.sha256 || \
|
||||
wget $UPGRADE_DOWNLOAD_SIGNATURE_URL -O /opt/mynode_release_latest.sha256
|
||||
else
|
||||
torify wget $UPGRADE_BETA_DOWNLOAD_URL -O /opt/mynode_release_latest.tar.gz
|
||||
torify wget $UPGRADE_BETA_DOWNLOAD_SIGNATURE_URL -O /opt/mynode_release_latest.sha256
|
||||
torify wget $UPGRADE_BETA_DOWNLOAD_URL -O /opt/mynode_release_latest.tar.gz || \
|
||||
wget $UPGRADE_BETA_DOWNLOAD_URL -O /opt/mynode_release_latest.tar.gz
|
||||
torify wget $UPGRADE_BETA_DOWNLOAD_SIGNATURE_URL -O /opt/mynode_release_latest.sha256 || \
|
||||
wget $UPGRADE_BETA_DOWNLOAD_SIGNATURE_URL -O /opt/mynode_release_latest.sha256
|
||||
fi
|
||||
torify wget $UPGRADE_PUBKEY_URL -O /opt/mynode_release.pub
|
||||
torify wget $UPGRADE_PUBKEY_URL -O /opt/mynode_release.pub || \
|
||||
wget $UPGRADE_PUBKEY_URL -O /opt/mynode_release.pub
|
||||
|
||||
openssl dgst -sha256 -verify /opt/mynode_release.pub -signature /opt/mynode_release_latest.sha256 /opt/mynode_release_latest.tar.gz
|
||||
if [ $? -ne 0 ]; then
|
||||
|
|
|
@ -166,9 +166,10 @@ def upgrade_device():
|
|||
|
||||
# Upgrade
|
||||
os.system("mkdir -p /home/admin/upgrade_logs")
|
||||
os.system("cp -f /usr/bin/mynode_upgrade.sh /usr/bin/mynode_upgrade_running.sh")
|
||||
file1 = "/home/admin/upgrade_logs/upgrade_log_from_{}_upgrade.txt".format(get_current_version())
|
||||
file2 = "/home/admin/upgrade_logs/upgrade_log_latest.txt"
|
||||
cmd = "/usr/bin/mynode_upgrade.sh 2>&1 | tee {} {}".format(file1, file2)
|
||||
cmd = "/usr/bin/mynode_upgrade_running.sh 2>&1 | tee {} {}".format(file1, file2)
|
||||
ret = subprocess.call(cmd, shell=True)
|
||||
if ret != 0:
|
||||
# Try one more time....
|
||||
|
@ -187,9 +188,10 @@ def upgrade_device_beta():
|
|||
|
||||
# Upgrade
|
||||
os.system("mkdir -p /home/admin/upgrade_logs")
|
||||
os.system("cp -f /usr/bin/mynode_upgrade.sh /usr/bin/mynode_upgrade_running.sh")
|
||||
file1 = "/home/admin/upgrade_logs/upgrade_log_from_{}_upgrade.txt".format(get_current_version())
|
||||
file2 = "/home/admin/upgrade_logs/upgrade_log_latest.txt"
|
||||
cmd = "/usr/bin/mynode_upgrade.sh beta 2>&1 | tee {} {}".format(file1, file2)
|
||||
cmd = "/usr/bin/mynode_upgrade_running.sh beta 2>&1 | tee {} {}".format(file1, file2)
|
||||
ret = subprocess.call(cmd, shell=True)
|
||||
if ret != 0:
|
||||
# Try one more time....
|
||||
|
|
Loading…
Reference in New Issue
Block a user