diff --git a/rootfs/standard/usr/bin/mount_drive.tcl b/rootfs/standard/usr/bin/mount_drive.tcl index e9a64201..c5ed049f 100755 --- a/rootfs/standard/usr/bin/mount_drive.tcl +++ b/rootfs/standard/usr/bin/mount_drive.tcl @@ -68,13 +68,13 @@ proc createMyNodeFsOnBlockDevice {blockDevice} { if [catch { puts "Waiting on format confirmation..." - runCommand echo "drive_format_confirm" > /mnt/hdd/mynode/.mynode_status + runCommand echo "drive_format_confirm" > /tmp/.mynode_status while { [file exists "/tmp/format_ok"] == 0 } { after 500 } puts "Creating new partition table on ${blockDevice}" - runCommand echo "drive_formatting" > /mnt/hdd/mynode/.mynode_status + runCommand echo "drive_formatting" > /tmp/.mynode_status runCommand /usr/bin/format_drive.sh ${blockDevice} after 5000 diff --git a/rootfs/standard/usr/bin/mynode_quicksync.sh b/rootfs/standard/usr/bin/mynode_quicksync.sh index 69d409f7..4a36a8e9 100755 --- a/rootfs/standard/usr/bin/mynode_quicksync.sh +++ b/rootfs/standard/usr/bin/mynode_quicksync.sh @@ -31,7 +31,7 @@ while [ -f /mnt/hdd/mynode/settings/quicksync_disabled ]; do sync # Give Bitcoin a couple minutes to start sleep 120s - echo "stable" > $MYNODE_DIR/.mynode_status + echo "stable" > $MYNODE_STATUS_FILE sync sleep 10d done @@ -39,7 +39,7 @@ done # Make sure folder exists mkdir -p $QUICKSYNC_DIR if [ ! -f $QUICKSYNC_DIR/.quicksync_download_complete ]; then - echo "quicksync_download" > $MYNODE_DIR/.mynode_status + echo "quicksync_download" > $MYNODE_STATUS_FILE fi echo "Starting quicksync..." @@ -50,7 +50,7 @@ if [ ! -f $QUICKSYNC_DIR/.quicksync_complete ] && [ -f $QUICKSYNC_DIR/.quicksync fi # Check if quicksync was completed if [ -f $QUICKSYNC_DIR/.quicksync_complete ]; then - echo "stable" > $MYNODE_DIR/.mynode_status + echo "stable" > $MYNODE_STATUS_FILE fi # Download torrent diff --git a/rootfs/standard/usr/bin/mynode_quicksync_complete.sh b/rootfs/standard/usr/bin/mynode_quicksync_complete.sh index e991bd1d..c1bdb515 100755 --- a/rootfs/standard/usr/bin/mynode_quicksync_complete.sh +++ b/rootfs/standard/usr/bin/mynode_quicksync_complete.sh @@ -14,7 +14,7 @@ touch $QUICKSYNC_DIR/.quicksync_download_complete sync # Copy files -echo "quicksync_copy" > $MYNODE_DIR/.mynode_status +echo "quicksync_copy" > $MYNODE_STATUS_FILE rm -rf $MYNODE_DIR/bitcoin/blocks/ rm -rf $MYNODE_DIR/bitcoin/chainstate/ tar -xvf $QUICKSYNC_DIR/blockchain*.tar.gz -C $MYNODE_DIR/bitcoin/ --dereference 2>&1 > /tmp/tar_log_$(date +%s) @@ -27,7 +27,7 @@ sleep 30s touch $QUICKSYNC_DIR/.quicksync_complete sync sleep 5m -echo "stable" > $MYNODE_DIR/.mynode_status +echo "stable" > $MYNODE_STATUS_FILE sync exit 0 \ No newline at end of file diff --git a/rootfs/standard/usr/bin/mynode_startup.sh b/rootfs/standard/usr/bin/mynode_startup.sh index 1666f3cf..1b205f05 100755 --- a/rootfs/standard/usr/bin/mynode_startup.sh +++ b/rootfs/standard/usr/bin/mynode_startup.sh @@ -97,7 +97,7 @@ set -e while [ ! -f /mnt/hdd/.mynode ] do # Clear status - rm -f $MYNODE_DIR/.mynode_status + rm -f $MYNODE_STATUS_FILE mount_drive.tcl || true sleep 5 done @@ -131,8 +131,8 @@ mkdir -p /mnt/hdd/mynode/whirlpool mkdir -p /mnt/hdd/mynode/lnbits mkdir -p /mnt/hdd/mynode/specter mkdir -p /tmp/flask_uploads -echo "drive_mounted" > $MYNODE_DIR/.mynode_status -chmod 777 $MYNODE_DIR/.mynode_status +echo "drive_mounted" > $MYNODE_STATUS_FILE +chmod 777 $MYNODE_STATUS_FILE rm -rf $MYNODE_DIR/.mynode_bitcoind_synced @@ -488,5 +488,5 @@ torify wget $LATEST_BETA_VERSION_URL -O /usr/share/mynode/latest_beta_version || # Update current state if [ -f $QUICKSYNC_DIR/.quicksync_complete ]; then - echo "stable" > $MYNODE_DIR/.mynode_status + echo "stable" > $MYNODE_STATUS_FILE fi diff --git a/rootfs/standard/usr/share/mynode/mynode_config.sh b/rootfs/standard/usr/share/mynode/mynode_config.sh index f803ec23..71de0e8f 100644 --- a/rootfs/standard/usr/share/mynode/mynode_config.sh +++ b/rootfs/standard/usr/share/mynode/mynode_config.sh @@ -43,6 +43,7 @@ SERIAL_NUM=$(mynode-get-device-serial) # Set all default / standard bash config settings MYNODE_DIR=/mnt/hdd/mynode +MYNODE_STATUS_FILE=/tmp/.mynode_status VPN_BACKUP_DIR=/mnt/hdd/mynode/vpn QUICKSYNC_DIR=/mnt/hdd/mynode/quicksync QUICKSYNC_CONFIG_DIR=/mnt/hdd/mynode/.config/transmission diff --git a/rootfs/standard/var/www/mynode/device_info.py b/rootfs/standard/var/www/mynode/device_info.py index 67e3f2a4..65eb1b46 100644 --- a/rootfs/standard/var/www/mynode/device_info.py +++ b/rootfs/standard/var/www/mynode/device_info.py @@ -454,7 +454,7 @@ def stop_quicksync(): os.system("systemctl stop quicksync") def restart_quicksync(): - os.system('echo "quicksync_reset" > /mnt/hdd/mynode/.mynode_status') + os.system('echo "quicksync_reset" > /tmp/.mynode_status') stop_bitcoind() stop_quicksync() delete_bitcoin_data() diff --git a/rootfs/standard/var/www/mynode/mynode.py b/rootfs/standard/var/www/mynode/mynode.py index e1d9204f..2827fe62 100644 --- a/rootfs/standard/var/www/mynode/mynode.py +++ b/rootfs/standard/var/www/mynode/mynode.py @@ -99,7 +99,7 @@ threads = [] ### Helper functions def get_status(): try: - status_file = "/mnt/hdd/mynode/.mynode_status" + status_file = "/tmp/.mynode_status" status = STATE_UNKNOWN # If its been a while, check for error conditions