mirror of
https://github.com/mynodebtc/mynode.git
synced 2024-12-25 22:18:07 +00:00
Add hook script capabilities
This commit is contained in:
parent
91c072e959
commit
4fec221654
|
@ -9,6 +9,7 @@ source /usr/share/mynode/mynode_app_versions.sh
|
|||
# NOTE: Background services will run before mynode service completes, so a drive MAY NOT be attached
|
||||
|
||||
COUNTER=0
|
||||
BITCOIN_SYNCED=0
|
||||
|
||||
while true; do
|
||||
|
||||
|
@ -31,6 +32,16 @@ while true; do
|
|||
fi
|
||||
fi
|
||||
|
||||
# Custom startup hook - post-bitcoin-synced
|
||||
if [ -f /usr/local/bin/mynode_hook_post_bitcoin_synced.sh ]; then
|
||||
if [ $BITCOIN_SYNCED == 0 ] && [ -f $BITCOIN_SYNCED_FILE ]; then
|
||||
/bin/bash /usr/local/bin/mynode_hook_post_bitcoin_synced.sh || true
|
||||
BITCOIN_SYNCED=1
|
||||
else
|
||||
BITCOIN_SYNCED=0
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
# Increment counter and sleep 1 min
|
||||
COUNTER=$((COUNTER+1))
|
||||
|
|
|
@ -136,6 +136,10 @@ fi
|
|||
rm -f /tmp/repairing_drive
|
||||
set -e
|
||||
|
||||
# Custom startup hook - pre-startup
|
||||
if [ -f /usr/local/bin/mynode_hook_pre_startup.sh ]; then
|
||||
/bin/bash /usr/local/bin/mynode_hook_pre_startup.sh || true
|
||||
fi
|
||||
|
||||
# Mount HDD (normal boot, format if necessary)
|
||||
while [ ! -f /mnt/hdd/.mynode ]
|
||||
|
@ -790,9 +794,10 @@ if [ -f /usr/share/joininbox/menu.update.sh ] && [ -f /home/joinmarket/menu.upda
|
|||
fi
|
||||
chown bitcoin:bitcoin /mnt/hdd/mynode/settings/.lndpw || true
|
||||
|
||||
# Check for new versions
|
||||
torify wget $LATEST_VERSION_URL --timeout=30 -O /usr/share/mynode/latest_version || true
|
||||
torify wget $LATEST_BETA_VERSION_URL --timeout=30 -O /usr/share/mynode/latest_beta_version || true
|
||||
# Custom startup hook - post-startup
|
||||
if [ -f /usr/local/bin/mynode_hook_post_startup.sh ]; then
|
||||
/bin/bash /usr/local/bin/mynode_hook_post_startup.sh || true
|
||||
fi
|
||||
|
||||
# Update current state
|
||||
if [ -f $QUICKSYNC_DIR/.quicksync_complete ]; then
|
||||
|
|
|
@ -110,7 +110,7 @@ def update_bitcoin_main_info_thread():
|
|||
bitcoin_block_height = get_bitcoin_block_height()
|
||||
mynode_block_height = get_mynode_block_height()
|
||||
remaining = bitcoin_block_height - mynode_block_height
|
||||
if remaining == 0 and bitcoin_block_height > 680000:
|
||||
if remaining == 0 and bitcoin_block_height > 710000:
|
||||
synced = True
|
||||
if not os.path.isfile(BITCOIN_SYNCED_FILE):
|
||||
open(BITCOIN_SYNCED_FILE, 'a').close() # touch file
|
||||
|
|
Loading…
Reference in New Issue
Block a user