diff --git a/rootfs/standard/usr/bin/mynode_get_latest_version.sh b/rootfs/standard/usr/bin/mynode_get_latest_version.sh new file mode 100755 index 00000000..ce443b08 --- /dev/null +++ b/rootfs/standard/usr/bin/mynode_get_latest_version.sh @@ -0,0 +1,13 @@ +#!/bin/bash + +set -x + +source /usr/share/mynode/mynode_config.sh + +torify wget $LATEST_VERSION_URL -O /usr/share/mynode/latest_version || \ + ( sleep 1s && torify wget $LATEST_VERSION_URL -O /usr/share/mynode/latest_version ) || \ + ( sleep 1s && wget $LATEST_VERSION_URL -O /usr/share/mynode/latest_version ) + +torify wget $LATEST_BETA_VERSION_URL -O /usr/share/mynode/latest_beta_version || \ + ( sleep 1s && torify wget $LATEST_BETA_VERSION_URL -O /usr/share/mynode/latest_beta_version ) || \ + ( sleep 1s && wget $LATEST_BETA_VERSION_URL -O /usr/share/mynode/latest_beta_version ) \ No newline at end of file diff --git a/rootfs/standard/usr/bin/mynode_post_www.sh b/rootfs/standard/usr/bin/mynode_post_www.sh index 5546c213..b8220a3c 100755 --- a/rootfs/standard/usr/bin/mynode_post_www.sh +++ b/rootfs/standard/usr/bin/mynode_post_www.sh @@ -4,7 +4,11 @@ source /usr/share/mynode/mynode_config.sh set -x -sleep 10s +sleep 2s -# Load webpage once to trigger initial load -curl http://localhost/ +# Load webpage once to trigger initial load - some setup is not triggered until first page load +curl http://localhost/ || \ + ( sleep 5s && curl http://localhost/ ) || \ + ( sleep 5s && curl http://localhost/ ) || \ + ( sleep 5s && curl http://localhost/ ) || \ + ( sleep 5s && curl http://localhost/ ) diff --git a/rootfs/standard/var/www/mynode/config.py b/rootfs/standard/var/www/mynode/config.py index 29dc301a..cf3e6cd2 100644 --- a/rootfs/standard/var/www/mynode/config.py +++ b/rootfs/standard/var/www/mynode/config.py @@ -8,8 +8,6 @@ CONFIG["btcrpcexplorer_enabled"] = True CONFIG["lndhub_enabled"] = True # myNode variables -LATEST_VERSION_URL = "https://www.mynodebtc.com/device/latest_version" -LATEST_BETA_VERSION_URL = "https://www.mynodebtc.com/device/latest_beta_version" CHECKIN_URL = "https://www.mynodebtc.com/device_api/check_in.php" # Bitcoin Variables diff --git a/rootfs/standard/var/www/mynode/device_info.py b/rootfs/standard/var/www/mynode/device_info.py index 7613aed1..e438bb3e 100644 --- a/rootfs/standard/var/www/mynode/device_info.py +++ b/rootfs/standard/var/www/mynode/device_info.py @@ -99,8 +99,7 @@ def get_current_beta_version(): return current_beta_version def update_latest_version(): - os.system("torify wget "+LATEST_VERSION_URL+" -O /usr/share/mynode/latest_version") - os.system("torify wget "+LATEST_BETA_VERSION_URL+" -O /usr/share/mynode/latest_beta_version") + os.system("/usr/bin/mynode_get_latest_version.sh") return True def get_latest_version():