diff --git a/rootfs/standard/usr/bin/mynode_startup.sh b/rootfs/standard/usr/bin/mynode_startup.sh index e5334afb..129d19ae 100755 --- a/rootfs/standard/usr/bin/mynode_startup.sh +++ b/rootfs/standard/usr/bin/mynode_startup.sh @@ -41,14 +41,17 @@ if [ $IS_RASPI -eq 1 ] || [ $IS_ROCKPRO64 -eq 1 ]; then fi umount /mnt/hdd || true -# Check for drive-repair -if [ -f /home/bitcoin/.mynode/check_drive ]; then - for d in /dev/sd*1; do - echo "Repairing drive $d ..."; - fsck -y $d - done - rm /home/bitcoin/.mynode/check_drive -fi +# Check drive +set +e +for d in /dev/sd*1; do + echo "Repairing drive $d ..."; + RC=$(fsck -y $d > /tmp/fsck_results 2>&1) + if [ $RC -ne 0 ]; then + touch /tmp/fsck_error + fi +done +set -e + # Mount HDD (format if necessary) while [ ! -f /mnt/hdd/.mynode ] diff --git a/rootfs/standard/var/www/mynode/device_info.py b/rootfs/standard/var/www/mynode/device_info.py index 25753b3c..bf90b926 100644 --- a/rootfs/standard/var/www/mynode/device_info.py +++ b/rootfs/standard/var/www/mynode/device_info.py @@ -120,6 +120,15 @@ def delete_product_key_error(): os.system("rm -rf /home/bitcoin/.mynode/.product_key_error") os.system("rm -rf /mnt/hdd/mynode/settings/.product_key_error") +def has_fsck_error(): + return os.path.isfile("/tmp/fsck_error") +def get_fsck_results(): + try: + with open("/tmp/fsck_results", "r") as f: + return f.read() + except: + return "ERROR" + return "ERROR" def get_local_ip(): local_ip = "unknown" diff --git a/rootfs/standard/var/www/mynode/mynode.py b/rootfs/standard/var/www/mynode/mynode.py index e1068d64..f8224ee3 100644 --- a/rootfs/standard/var/www/mynode/mynode.py +++ b/rootfs/standard/var/www/mynode/mynode.py @@ -369,6 +369,8 @@ def index(): "vpn_enabled": is_vpn_enabled(), "product_key_skipped": pk_skipped, "product_key_error": pk_error, + "fsck_error": has_fsck_error(), + "fsck_results": get_fsck_results(), "drive_usage": get_drive_usage(), "cpu_usage": get_cpu_usage(), "ram_usage": get_ram_usage(), diff --git a/rootfs/standard/var/www/mynode/settings.py b/rootfs/standard/var/www/mynode/settings.py index 0f76c8dc..176e88ae 100644 --- a/rootfs/standard/var/www/mynode/settings.py +++ b/rootfs/standard/var/www/mynode/settings.py @@ -385,27 +385,6 @@ def download_logs_page(): return send_from_directory(directory="/tmp/", filename="mynode_logs.tar.gz") -@mynode_settings.route("/settings/repair-drive") -def repair_drive_page(): - check_logged_in() - - # Touch files to trigger re-checking drive - os.system("touch /home/bitcoin/.mynode/check_drive") - os.system("sync") - - # Trigger reboot - t = Timer(1.0, reboot_device) - t.start() - - # Wait until device is restarted - templateData = { - "title": "myNode Reboot", - "header_text": "Restarting", - "subheader_text": "This will take several minutes...", - "ui_settings": read_ui_settings() - } - return render_template('reboot.html', **templateData) - @mynode_settings.route("/settings/regen-https-certs") def regen_https_certs_page(): check_logged_in() diff --git a/rootfs/standard/var/www/mynode/templates/main.html b/rootfs/standard/var/www/mynode/templates/main.html index 5341adc3..98bf34b9 100644 --- a/rootfs/standard/var/www/mynode/templates/main.html +++ b/rootfs/standard/var/www/mynode/templates/main.html @@ -133,6 +133,15 @@ {% include 'includes/message_display.html' %} + {% if fsck_error %} +
+
+

There may be an error with the filesystem on your drive.

+

{{ fsck_results }}

+
+
+ {% endif %} + {% if not has_changed_password %}

Warning!
You appear to be using the default password! You should change it to something else on the settings page.

diff --git a/rootfs/standard/var/www/mynode/templates/settings.html b/rootfs/standard/var/www/mynode/templates/settings.html index 58adb725..adf1d844 100644 --- a/rootfs/standard/var/www/mynode/templates/settings.html +++ b/rootfs/standard/var/www/mynode/templates/settings.html @@ -617,13 +617,6 @@
-
Repair Drive
- This will attempt to repair and block errors on your external drive. Please make a backup before running. This will reboot the device. -
- Repair Drive - -
-
Factory Reset
This will factory reset your mynode and all storage will be completely reset. Make sure you have backed up all your keys and wallets!