mirror of
https://github.com/raspiblitz/raspiblitz.git
synced 2025-04-13 22:29:20 +02:00
change detecting presync
This commit is contained in:
parent
71cbf27fff
commit
2e89504c9e
@ -16,6 +16,10 @@ infoFile="/home/admin/raspiblitz.info"
|
||||
echo "presync: waiting 2 secs" >> $logFile
|
||||
sleep 2
|
||||
|
||||
# just in case an old presync did not shutdown properly
|
||||
sudo systemctl stop bitcoind.service 2>/dev/null
|
||||
sudo systemctl disable bitcoind.service 2>/dev/null
|
||||
|
||||
echo "presync: copying files" >> $logFile
|
||||
sudo cp /home/admin/assets/bitcoin.conf /mnt/hdd/bitcoin/bitcoin.conf
|
||||
sudo cp /home/admin/assets/bitcoind.service /etc/systemd/system/bitcoind.service
|
||||
|
@ -186,19 +186,19 @@ if [ ${hddIsAutoMounted} -eq 0 ]; then
|
||||
echo "Found pre-loaded blockchain" >> $logFile
|
||||
|
||||
# check if pre-sync was already activated on last power-on
|
||||
presyncActive=$(systemctl status bitcoind | grep -c 'could not be found')
|
||||
if [ ${presyncActive} -eq 1]; then
|
||||
#presyncActive=$(systemctl status bitcoind | grep -c 'could not be found')
|
||||
#if [ ${presyncActive} -eq 1]; then
|
||||
echo "starting pre-sync in background" >> $logFile
|
||||
# starting in background, because this scripts is part of systemd
|
||||
# so to change systemd needs to happen after delay in seperate process
|
||||
/home/admin/_bootstrap.presync.sh &
|
||||
else
|
||||
echo "pre-sync is already active" >> $logFile
|
||||
# update info file
|
||||
echo "state=presync" > $infoFile
|
||||
echo "message='pre-sync active'" >> $infoFile
|
||||
echo "device=${hddDeviceName}" >> $infoFile
|
||||
fi
|
||||
#else
|
||||
# echo "pre-sync is already active" >> $logFile
|
||||
# # update info file
|
||||
# echo "state=presync" > $infoFile
|
||||
# echo "message='pre-sync active'" >> $infoFile
|
||||
# echo "device=${hddDeviceName}" >> $infoFile
|
||||
#fi
|
||||
|
||||
# after admin login, presync will be stoped and HDD unmounted
|
||||
exit 1
|
||||
|
Loading…
x
Reference in New Issue
Block a user