Add status page for repairing drive

This commit is contained in:
Taylor Helsper 2019-12-21 21:27:14 -06:00
parent 46b042941e
commit cc64f2b535
3 changed files with 16 additions and 0 deletions

View File

@ -43,6 +43,7 @@ umount /mnt/hdd || true
# Check drive # Check drive
set +e set +e
touch /tmp/repairing_drive
for d in /dev/sd*1; do for d in /dev/sd*1; do
echo "Repairing drive $d ..."; echo "Repairing drive $d ...";
RC=$(fsck -y $d > /tmp/fsck_results 2>&1) RC=$(fsck -y $d > /tmp/fsck_results 2>&1)
@ -50,6 +51,7 @@ for d in /dev/sd*1; do
touch /tmp/fsck_error touch /tmp/fsck_error
fi fi
done done
rm -f /tmp/repairing_drive
set -e set -e

View File

@ -120,6 +120,8 @@ def delete_product_key_error():
os.system("rm -rf /home/bitcoin/.mynode/.product_key_error") os.system("rm -rf /home/bitcoin/.mynode/.product_key_error")
os.system("rm -rf /mnt/hdd/mynode/settings/.product_key_error") os.system("rm -rf /mnt/hdd/mynode/settings/.product_key_error")
def is_drive_being_repaired():
return os.path.isfile("/tmp/repairing_drive")
def has_fsck_error(): def has_fsck_error():
return os.path.isfile("/tmp/fsck_error") return os.path.isfile("/tmp/fsck_error")
def get_fsck_results(): def get_fsck_results():

View File

@ -18,6 +18,7 @@ from lightning_info import *
from messages import get_message from messages import get_message
from thread_functions import * from thread_functions import *
from datetime import timedelta from datetime import timedelta
from device_info import *
import pam import pam
import json import json
import random import random
@ -115,6 +116,17 @@ def index():
return render_template('uploader.html', **templateData) return render_template('uploader.html', **templateData)
if status == STATE_DRIVE_MISSING: if status == STATE_DRIVE_MISSING:
# Drive may be getting repaired
if is_drive_being_repaired():
templateData = {
"title": "myNode Repairing Drive",
"header_text": "Repairing Drive",
"subheader_text": Markup("Drive is being checked and repaired...<br/><br/>This will take several hours."),
"ui_settings": read_ui_settings()
}
return render_template('state.html', **templateData)
templateData = { templateData = {
"title": "myNode Looking for Drive", "title": "myNode Looking for Drive",
"header_text": "Looking for Drive", "header_text": "Looking for Drive",