Default disable QS on SSDs
This commit is contained in:
parent
8bb44864ac
commit
37c81fcb54
|
@ -19,7 +19,7 @@ cp -f /usr/share/quicksync/settings.json $QUICKSYNC_CONFIG_DIR/settings.json
|
||||||
sleep 15s
|
sleep 15s
|
||||||
|
|
||||||
# Check if quicksync was disabled
|
# Check if quicksync was disabled
|
||||||
while [ -f /home/bitcoin/.mynode/quicksync_disabled ] || [ -f /mnt/hdd/mynode/settings/quicksync_disabled ]; do
|
while [ -f /mnt/hdd/mynode/settings/quicksync_disabled ]; do
|
||||||
# Pretend quicksync step is complete
|
# Pretend quicksync step is complete
|
||||||
touch $QUICKSYNC_DIR/.quicksync_download_complete
|
touch $QUICKSYNC_DIR/.quicksync_download_complete
|
||||||
touch $QUICKSYNC_DIR/.quicksync_complete
|
touch $QUICKSYNC_DIR/.quicksync_complete
|
||||||
|
|
|
@ -79,8 +79,6 @@ useradd -m -s /bin/bash pivpn || true
|
||||||
|
|
||||||
# Regen SSH keys (check if force regen or keys are missing / empty)
|
# Regen SSH keys (check if force regen or keys are missing / empty)
|
||||||
while [ ! -f /home/bitcoin/.mynode/.gensshkeys ] ||
|
while [ ! -f /home/bitcoin/.mynode/.gensshkeys ] ||
|
||||||
[ ! -f /mnt/hdd/mynode/settings/.btcrpcpw ] ||
|
|
||||||
[ ! -s /mnt/hdd/mynode/settings/.btcrpcpw ] ||
|
|
||||||
[ ! -f /etc/ssh/ssh_host_ecdsa_key.pub ] ||
|
[ ! -f /etc/ssh/ssh_host_ecdsa_key.pub ] ||
|
||||||
[ ! -s /etc/ssh/ssh_host_ecdsa_key.pub ] ||
|
[ ! -s /etc/ssh/ssh_host_ecdsa_key.pub ] ||
|
||||||
[ ! -f /etc/ssh/ssh_host_ed25519_key.pub ] ||
|
[ ! -f /etc/ssh/ssh_host_ed25519_key.pub ] ||
|
||||||
|
@ -94,6 +92,8 @@ do
|
||||||
systemctl restart ssh
|
systemctl restart ssh
|
||||||
|
|
||||||
touch /home/bitcoin/.mynode/.gensshkeys
|
touch /home/bitcoin/.mynode/.gensshkeys
|
||||||
|
sync
|
||||||
|
sleep 5s
|
||||||
done
|
done
|
||||||
|
|
||||||
# Sync product key (SD preferred)
|
# Sync product key (SD preferred)
|
||||||
|
@ -115,6 +115,23 @@ if [ ! -f /mnt/hdd/mynode/settings/.lndalias ]; then
|
||||||
echo "mynodebtc.com [myNode]" > /mnt/hdd/mynode/settings/.lndalias
|
echo "mynodebtc.com [myNode]" > /mnt/hdd/mynode/settings/.lndalias
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Default QuickSync
|
||||||
|
if [ ! -f /mnt/hdd/mynode/settings/.setquicksyncdefault ]; then
|
||||||
|
rm -f /mnt/hdd/mynode/settings/quicksync_disabled
|
||||||
|
|
||||||
|
# Default x86 to no QuickSync
|
||||||
|
if [ $IS_X86 = 1 ]; then
|
||||||
|
touch /mnt/hdd/mynode/settings/quicksync_disabled
|
||||||
|
fi
|
||||||
|
# Default SSD to no QuickSync
|
||||||
|
DRIVE=$(cat /tmp/.mynode_drive)
|
||||||
|
HDD=$(lsblk $DRIVE -o ROTA | tail -n 1 | tr -d '[:space:]')
|
||||||
|
if [ "$HDD" = "0" ]; then
|
||||||
|
touch /mnt/hdd/mynode/settings/quicksync_disabled
|
||||||
|
fi
|
||||||
|
touch /mnt/hdd/mynode/settings/.setquicksyncdefault
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
# BTC Config
|
# BTC Config
|
||||||
cp -f /usr/share/mynode/bitcoin.conf /mnt/hdd/mynode/bitcoin/bitcoin.conf
|
cp -f /usr/share/mynode/bitcoin.conf /mnt/hdd/mynode/bitcoin/bitcoin.conf
|
||||||
|
|
|
@ -63,13 +63,10 @@ def unset_uploader():
|
||||||
|
|
||||||
|
|
||||||
def is_quicksync_enabled():
|
def is_quicksync_enabled():
|
||||||
return not os.path.isfile("/home/bitcoin/.mynode/quicksync_disabled") and \
|
return not os.path.isfile("/mnt/hdd/mynode/settings/quicksync_disabled")
|
||||||
not os.path.isfile("/mnt/hdd/mynode/settings/quicksync_disabled")
|
|
||||||
def disable_quicksync():
|
def disable_quicksync():
|
||||||
os.system("touch /home/bitcoin/.mynode/quicksync_disabled")
|
|
||||||
os.system("touch /mnt/hdd/mynode/settings/quicksync_disabled")
|
os.system("touch /mnt/hdd/mynode/settings/quicksync_disabled")
|
||||||
def enable_quicksync():
|
def enable_quicksync():
|
||||||
os.system("rm -rf /home/bitcoin/.mynode/quicksync_disabled")
|
|
||||||
os.system("rm -rf /mnt/hdd/mynode/settings/quicksync_disabled")
|
os.system("rm -rf /mnt/hdd/mynode/settings/quicksync_disabled")
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user