diff --git a/rootfs/standard/usr/bin/mynode_www.sh b/rootfs/standard/usr/bin/mynode_www.sh index 109c80d9..103037ab 100755 --- a/rootfs/standard/usr/bin/mynode_www.sh +++ b/rootfs/standard/usr/bin/mynode_www.sh @@ -3,5 +3,14 @@ if [ -f /home/bitcoin/.mynode/.www_use_python3 ]; then exec /usr/local/bin/python3 /var/www/mynode/mynode.py else - exec /usr/bin/python2.7 /var/www/mynode/mynode.py + # If not forcing python3, use prefer python3 unless in restart cycle + count=$(journalctl -b -u www.service | grep -c "Started myNode Web Server") + modcount=$(($count % 5)) + if [ "$modcount" -eq 4 ]; then + echo "RESTART COUNT: $modcount (PYTHON2)" + exec /usr/bin/python2.7 /var/www/mynode/mynode.py + else + echo "RESTART COUNT: $modcount (PYTHON3)" + exec /usr/local/bin/python3 /var/www/mynode/mynode.py + fi fi \ No newline at end of file