diff --git a/home.admin/00infoLCD.sh b/home.admin/00infoLCD.sh index d0095da..40e21f9 100755 --- a/home.admin/00infoLCD.sh +++ b/home.admin/00infoLCD.sh @@ -97,7 +97,7 @@ while : source /home/admin/raspiblitz.info if [ "${state}" = "presync" ]; then # get blockchain sync progress - blockchaininfo="$(bitcoin-cli -datadir=/mnt/hdd/bitcoin getblockchaininfo 2>/dev/null)" + blockchaininfo="$(sudo -u root bitcoin-cli -conf=/home/admin/assets/bitcoin.conf getblockchaininfo 2>/dev/null)" if [ ${#blockchaininfo} -gt 0 ]; then message="$(echo "${blockchaininfo}" | jq -r '.verificationprogress')" fi diff --git a/home.admin/00mainMenu.sh b/home.admin/00mainMenu.sh index 33aa0d0..609bb4f 100755 --- a/home.admin/00mainMenu.sh +++ b/home.admin/00mainMenu.sh @@ -16,14 +16,14 @@ if [ ${bootstrapInfoExists} -eq 1 ]; then echo "********************************************" echo "Stopping pre-sync ... pls wait (up to 1min)" echo "********************************************" - sudo systemctl stop bitcoind.service - sudo systemctl disable bitcoind.service - sudo rm /mnt/hdd/bitcoin/bitcoin.conf - sudo rm /etc/systemd/system/bitcoind.service - sudo unlink /home/bitcoin/.bitcoin + sudo -u root bitcoin-cli -conf=/home/admin/assets/bitcoin.conf stop + echo "bitcoind called to stop .." + sleep 10 # unmount the temporary mount + echo "Unmount HDD .." sudo umount -l /mnt/hdd + sleep 3 # update info file state=waitsetup diff --git a/home.admin/_bootstrap.presync.sh b/home.admin/_bootstrap.presync.sh index 0c362b7..e89b957 100644 --- a/home.admin/_bootstrap.presync.sh +++ b/home.admin/_bootstrap.presync.sh @@ -15,7 +15,7 @@ infoFile="/home/admin/raspiblitz.info" #sudo systemctl stop bitcoind.service 2>/dev/null #sudo systemctl disable bitcoind.service 2>/dev/null -echo "presync: bitcoind" >> $logFile +#echo "presync: bitcoind" >> $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 #sudo chmod +x /etc/systemd/system/bitcoind.service @@ -24,10 +24,10 @@ echo "presync: bitcoind" >> $logFile #sudo systemctl daemon-reload #sudo systemctl enable bitcoind.service #sudo systemctl start bitcoind.service -sudo chown -R bitcoin:bitcoin /mnt/hdd/bitcoin -sudo -u bitcoin /usr/local/bin/bitcoind -daemon -conf=/home/admin/assets/bitcoin.conf -pid=/mnt/hdd/bitcoin/bitcoind.pid -echo "presync: started" >> $logFile +#sudo chown -R bitcoin:bitcoin /mnt/hdd/bitcoin +#sudo -u bitcoin /usr/local/bin/bitcoind -daemon -conf=/home/admin/assets/bitcoin.conf -pid=/mnt/hdd/bitcoin/bitcoind.pid +#echo "presync: started" >> $logFile # update info file -echo "state=presync" > $infoFile -sudo sed -i "s/^message=.*/message='running pre-sync'/g" ${infoFile} +#echo "state=presync" > $infoFile +#sudo sed -i "s/^message=.*/message='running pre-sync'/g" ${infoFile} diff --git a/home.admin/_bootstrap.sh b/home.admin/_bootstrap.sh index a0cd32b..bb72b0e 100644 --- a/home.admin/_bootstrap.sh +++ b/home.admin/_bootstrap.sh @@ -187,7 +187,7 @@ if [ ${hddIsAutoMounted} -eq 0 ]; then # update info file echo "state=presync" > $infoFile - echo "message='starting pre-sync'" >> $infoFile + echo "message='starting presync'" >> $infoFile # activating presync # so that on a hackathon you can just connect a RaspiBlitz @@ -199,9 +199,10 @@ if [ ${hddIsAutoMounted} -eq 0 ]; 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 & - echo "done" >> $logFile - + sudo chown -R bitcoin:bitcoin /mnt/hdd/bitcoin 2>> $logFile + sudo -u bitcoin /usr/local/bin/bitcoind -daemon -conf=/home/admin/assets/bitcoin.conf -pid=/mnt/hdd/bitcoin/bitcoind.pid 2>> $logFile + echo "OK Started bitcoind for presync" >> $logFile + sudo sed -i "s/^message=.*/message='running presync'/g" ${infoFile} # after admin login, presync will be stoped and HDD unmounted exit 0