diff --git a/rootfs/standard/usr/bin/mynode_gen_debug_tarball.sh b/rootfs/standard/usr/bin/mynode_gen_debug_tarball.sh new file mode 100755 index 00000000..a6ad3a66 --- /dev/null +++ b/rootfs/standard/usr/bin/mynode_gen_debug_tarball.sh @@ -0,0 +1,27 @@ +#!/bin/bash + +set -x + +# Clean space for tarball + setup +rm -rf /tmp/mynode_logs.tar.gz +rm -rf /tmp/mynode_info/ +mkdir -p /tmp/mynode_info/ + +# Save helpful info +mynode-get-quicksync-status > /tmp/mynode_info/quicksync_state.txt +cp /usr/share/mynode/version /tmp/mynode_info/version +cp -rf /home/admin/upgrade_logs /tmp/mynode_info/ +cp /mnt/hdd/mynode/bitcoin/debug.log /tmp/mynode_info/bitcoin_debug.log + +echo "" > /tmp/mynode_info/device_info +echo "##### df -h #####" >> /tmp/mynode_info/device_info +df -h >> /tmp/mynode_info/device_info +echo "" >> /tmp/mynode_info/device_info +echo "##### mount #####" >> /tmp/mynode_info/device_info +mount >> /tmp/mynode_info/device_info +echo "" >> /tmp/mynode_info/device_info +echo "##### docker ps #####" >> /tmp/mynode_info/device_info +docker ps >> /tmp/mynode_info/device_info + +# Create tarball +tar -czvf /tmp/mynode_logs.tar.gz /var/log/ /tmp/mynode_info/ \ No newline at end of file diff --git a/rootfs/standard/var/www/mynode/settings.py b/rootfs/standard/var/www/mynode/settings.py index 494d501e..a687a92c 100644 --- a/rootfs/standard/var/www/mynode/settings.py +++ b/rootfs/standard/var/www/mynode/settings.py @@ -373,14 +373,9 @@ def page_reset_tor(): @mynode_settings.route("/settings/mynode_logs.tar.gz") def download_logs_page(): check_logged_in() - os.system("rm -rf /tmp/mynode_logs.tar.gz") - os.system("rm -rf /tmp/mynode_info/") - os.system("mkdir -p /tmp/mynode_info/") - os.system("mynode-get-quicksync-status > /tmp/mynode_info/quicksync_state.txt") - os.system("cp /usr/share/mynode/version /tmp/mynode_info/version") - os.system("cp -rf /home/admin/upgrade_logs /tmp/mynode_info/") - os.system("cp /mnt/hdd/mynode/bitcoin/debug.log /tmp/mynode_info/bitcoin_debug.log") - os.system("tar -czvf /tmp/mynode_logs.tar.gz /var/log/ /tmp/mynode_info/") + + os.system("/usr/bin/mynode_gen_debug_tarball.sh") + return send_from_directory(directory="/tmp/", filename="mynode_logs.tar.gz") @mynode_settings.route("/settings/repair-drive")