From bd7d1969c724289b1e2ebcf76e5a011a3f6b81d0 Mon Sep 17 00:00:00 2001 From: Taylor Helsper Date: Sat, 13 Jul 2019 13:26:00 -0500 Subject: [PATCH] Move transmission dir to HDD so it doesn't have to verify if a new SD card is used --- rootfs/standard/usr/bin/mynode_quicksync.sh | 1 + rootfs/standard/usr/bin/mynode_startup.sh | 5 +++++ rootfs/standard/usr/share/mynode/mynode_config.sh | 2 +- rootfs/standard/var/www/mynode/settings.py | 3 ++- 4 files changed, 9 insertions(+), 2 deletions(-) diff --git a/rootfs/standard/usr/bin/mynode_quicksync.sh b/rootfs/standard/usr/bin/mynode_quicksync.sh index 3b9e9d77..c193c5d1 100755 --- a/rootfs/standard/usr/bin/mynode_quicksync.sh +++ b/rootfs/standard/usr/bin/mynode_quicksync.sh @@ -82,5 +82,6 @@ fi echo "Running torrent..." transmission-cli \ --download-dir $QUICKSYNC_DIR \ + --config-dir $QUICKSYNC_CONFIG_DIR \ --finish=/usr/bin/mynode_quicksync_complete.sh \ $QUICKSYNC_DIR/blockchain.torrent diff --git a/rootfs/standard/usr/bin/mynode_startup.sh b/rootfs/standard/usr/bin/mynode_startup.sh index 14b14ab9..6961d6d5 100755 --- a/rootfs/standard/usr/bin/mynode_startup.sh +++ b/rootfs/standard/usr/bin/mynode_startup.sh @@ -50,6 +50,7 @@ done # Setup Drive mkdir -p /mnt/hdd/mynode mkdir -p /mnt/hdd/mynode/settings +mkdir -p /mnt/hdd/mynode/.config mkdir -p /mnt/hdd/mynode/bitcoin mkdir -p /mnt/hdd/mynode/lnd mkdir -p /mnt/hdd/mynode/quicksync @@ -149,6 +150,10 @@ USER=$(stat -c '%U' /mnt/hdd/mynode/settings) if [ "$USER" != "bitcoin" ]; then chown -R bitcoin:bitcoin /mnt/hdd/mynode/settings fi +USER=$(stat -c '%U' /mnt/hdd/mynode/.config) +if [ "$USER" != "bitcoin" ]; then + chown -R bitcoin:bitcoin /mnt/hdd/mynode/.config +fi USER=$(stat -c '%U' /mnt/hdd/mynode/bitcoin) if [ "$USER" != "bitcoin" ]; then chown -R bitcoin:bitcoin /mnt/hdd/mynode/bitcoin diff --git a/rootfs/standard/usr/share/mynode/mynode_config.sh b/rootfs/standard/usr/share/mynode/mynode_config.sh index ff115ba4..6b8e35d2 100644 --- a/rootfs/standard/usr/share/mynode/mynode_config.sh +++ b/rootfs/standard/usr/share/mynode/mynode_config.sh @@ -13,7 +13,7 @@ SERIAL_NUM=$(cat /proc/cpuinfo | grep Serial | cut -d ' ' -f 2) # Set all default / standard bash config settings MYNODE_DIR=/mnt/hdd/mynode QUICKSYNC_DIR=/mnt/hdd/mynode/quicksync -QUICKSYNC_CONFIG_DIR=/home/bitcoin/.config/transmission +QUICKSYNC_CONFIG_DIR=/mnt/hdd/mynode/.config/transmission QUICKSYNC_TORRENT_URL="https://mynodebtc.com/device/blockchain.tar.gz.torrent" QUICKSYNC_BANDWIDTH_FILE="/mnt/hdd/mynode/settings/.bandwidth" LND_BACKUP_FOLDER="/home/bitcoin/lnd_backup/" diff --git a/rootfs/standard/var/www/mynode/settings.py b/rootfs/standard/var/www/mynode/settings.py index 592bfad7..dce1fba9 100644 --- a/rootfs/standard/var/www/mynode/settings.py +++ b/rootfs/standard/var/www/mynode/settings.py @@ -37,7 +37,8 @@ def delete_bitcoin_data(): def delete_quicksync_data(): os.system("rm -rf /mnt/hdd/mynode/quicksync") - os.system("rm -rf /home/bitcoin/.config/transmission") + os.system("rm -rf /home/bitcoin/.config/transmission") # Old dir + os.system("rm -rf /mnt/hdd/mynode/.config/transmission") def delete_lnd_data(): #os.system("rm -f "+LND_WALLET_FILE)