mirror of
https://github.com/mynodebtc/mynode.git
synced 2024-12-26 14:34:00 +00:00
Devices won't check for new QS data
This commit is contained in:
parent
884a2f426a
commit
2e0ccc0d5a
|
@ -4,45 +4,36 @@ source /usr/share/mynode/mynode_config.sh
|
|||
|
||||
echo "Waiting until QuickSync is complete..."
|
||||
while [ ! -f "$QUICKSYNC_COMPLETE_FILE" ]; do
|
||||
sleep 1m
|
||||
sleep 1h
|
||||
done
|
||||
if [ ! -f $UPLOADER_FILE ]; then
|
||||
echo "Quicksync Complete! Waiting until Bitcoin Sync is complete..."
|
||||
while [ ! -f "$BITCOIN_SYNCED_FILE" ]; do
|
||||
sleep 1m
|
||||
done
|
||||
echo "Bitcoin Sync Complete! Checking if there is a new torrent available..."
|
||||
sleep 1d
|
||||
fi
|
||||
|
||||
while true; do
|
||||
# Wait a while... we don't want everyone starting on a new torrent at once
|
||||
if [ -f $UPLOADER_FILE ]; then
|
||||
echo "Marked as uploader, checking for new torrent in 1 day..."
|
||||
sleep 1d
|
||||
else
|
||||
sleep 10d
|
||||
echo "Marked as uploader, checking for new torrent..."
|
||||
|
||||
# Download current torrent
|
||||
rm -rf /tmp/blockchain_temp.torrent
|
||||
if [ -f $UPLOADER_FILE ]; then
|
||||
wget -O /tmp/blockchain_temp.torrent $QUICKSYNC_TORRENT_BETA_URL
|
||||
else
|
||||
wget -O /tmp/blockchain_temp.torrent $QUICKSYNC_TORRENT_URL
|
||||
fi
|
||||
if [ -f /tmp/blockchain_temp.torrent ]; then
|
||||
NEW_TORRENT=0
|
||||
cmp --silent /tmp/blockchain_temp.torrent $QUICKSYNC_DIR/blockchain.torrent || NEW_TORRENT=1
|
||||
if [ $NEW_TORRENT -eq 1 ]; then
|
||||
# Reboot to restart and get new torrent
|
||||
reboot
|
||||
else
|
||||
echo "Torrent has not changed."
|
||||
fi
|
||||
else
|
||||
echo "Torrent download failed...."
|
||||
fi
|
||||
fi
|
||||
|
||||
# Download current torrent
|
||||
rm -rf /tmp/blockchain_temp.torrent
|
||||
if [ -f $UPLOADER_FILE ]; then
|
||||
wget -O /tmp/blockchain_temp.torrent $QUICKSYNC_TORRENT_BETA_URL
|
||||
else
|
||||
wget -O /tmp/blockchain_temp.torrent $QUICKSYNC_TORRENT_URL
|
||||
fi
|
||||
if [ -f /tmp/blockchain_temp.torrent ]; then
|
||||
NEW_TORRENT=0
|
||||
cmp --silent /tmp/blockchain_temp.torrent $QUICKSYNC_DIR/blockchain.torrent || NEW_TORRENT=1
|
||||
if [ $NEW_TORRENT -eq 1 ]; then
|
||||
# Reboot to restart and get new torrent
|
||||
reboot
|
||||
else
|
||||
echo "Torrent has not changed."
|
||||
fi
|
||||
else
|
||||
echo "Torrent download failed...."
|
||||
fi
|
||||
sleep 1d
|
||||
done
|
||||
|
||||
# Should never exit
|
||||
|
|
Loading…
Reference in New Issue
Block a user