mirror of
https://github.com/Retropex/raspiblitz.git
synced 2025-05-12 19:20:48 +02:00
setting message thru cache
This commit is contained in:
parent
be61a528ff
commit
aaf99c412a
@ -135,8 +135,7 @@ do
|
||||
|
||||
# sync bitcoin
|
||||
echo "# Syncing Bitcoin to template folder ..."
|
||||
|
||||
sed -i "s/^message=.*/message='Updating Template: Bitcoin'/g" /home/admin/raspiblitz.info
|
||||
/home/admin/_cache.sh set message "Updating Template: Bitcoin"
|
||||
|
||||
# make sure the bitcoin directory in template folder exists
|
||||
if [ ! -d "$pathTemplateHDD/bitcoin" ]; then
|
||||
@ -189,13 +188,13 @@ do
|
||||
echo "size: ${size}"
|
||||
if [ ${size} -lt 900000000000 ]; then
|
||||
echo "!! THE HDD/SSD IS TOO SMALL <900GB - use at least 1TB"
|
||||
sed -i "s/^message=.*/message='HDD smaller than 1TB: ${detectedDrive}'/g" /home/admin/raspiblitz.info
|
||||
/home/admin/_cache.sh set message "HDD smaller than 1TB: ${detectedDrive}"
|
||||
echo
|
||||
sleep 10
|
||||
else
|
||||
|
||||
choice=0
|
||||
sed -i "s/^message=.*/message='Formatting new HDD: ${detectedDrive}'/g" /home/admin/raspiblitz.info
|
||||
/home/admin/_cache.sh set message "Formatting new HDD: ${detectedDrive}"
|
||||
|
||||
# format the HDD
|
||||
echo "Starting Formatting of device ${detectedDrive} ..."
|
||||
@ -225,7 +224,7 @@ do
|
||||
mountOK=$(lsblk -o NAME,MOUNTPOINT | grep "${detectedDrive}" | grep -c "/mnt/hdd2")
|
||||
if [ ${mountOK} -eq 1 ]; then
|
||||
hddsInfoString=$(cat /var/cache/raspiblitz/copystationHddsInfoString.tmp | tr '\n' ' ')
|
||||
sed -i "s/^message=.*/message='${hddsInfoString} ${partition}>SYNC'/g" /home/admin/raspiblitz.info
|
||||
/home/admin/_cache.sh set message "${hddsInfoString} ${partition}>SYNC"
|
||||
rsync -a --info=progress2 --delete ${pathTemplateHDD}/* /mnt/hdd2
|
||||
chmod -R 777 /mnt/hdd2
|
||||
rm -r /mnt/hdd2/lost+found 2>/dev/null
|
||||
@ -269,7 +268,7 @@ do
|
||||
echo "To stop copystation script: CTRL+c and then 'restart'"
|
||||
echo "You can close SSH terminal and script will run in background can can be re-entered."
|
||||
|
||||
sed -i "s/^message=.*/message='No target HDDs connected - connect USB Hub'/g" /home/admin/raspiblitz.info
|
||||
/home/admin/_cache.sh set message "No target HDDs connected - connect USB Hub"
|
||||
firstLoop=1
|
||||
sleep 30
|
||||
|
||||
@ -285,7 +284,7 @@ do
|
||||
echo "To stop copystation script: CTRL+c and then 'restart'"
|
||||
echo "You can close SSH terminal and script will run in background can can be re-entered."
|
||||
|
||||
sed -i "s/^message=.*/message='Ready HDDs: ${hddsInfoString}'/g" /home/admin/raspiblitz.info
|
||||
/home/admin/_cache.sh set message "Ready HDDs: ${hddsInfoString}"
|
||||
sleep 25
|
||||
|
||||
fi
|
||||
|
@ -535,8 +535,8 @@ if [ ${isMounted} -eq 0 ]; then
|
||||
|
||||
# check that HDD was temp mounted
|
||||
if [ "${isMounted}" != "1" ]; then
|
||||
sed -i "s/^state=.*/state=errorHDD/g" ${infoFile}
|
||||
sed -i "s/^message=.*/message='Was not able to mount HDD (2)'/g" ${infoFile}
|
||||
/home/admin/_cache.sh set state "errorHDD"
|
||||
/home/admin/_cache.sh set message "Was not able to mount HDD (2)"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
@ -574,7 +574,7 @@ if [ ${isMounted} -eq 0 ]; then
|
||||
echo "##### IMPORT MIGRATIONFILE: ${migrationFile}" >> ${logFile}
|
||||
|
||||
# unpack
|
||||
sed -i "s/^message=.*/message='Unpacking Migration Data'/g" ${infoFile}
|
||||
/home/admin/_cache.sh set message "Unpacking Migration Data"
|
||||
source <(/home/admin/config.scripts/blitz.migration.sh import "${migrationFile}")
|
||||
|
||||
# check for errors
|
||||
@ -624,7 +624,7 @@ if [ ${isMounted} -eq 0 ]; then
|
||||
if [ "${setupPhase}" == "setup" ]; then
|
||||
echo "Calling _provision.setup.sh for basic setup tasks .." >> $logFile
|
||||
echo "Follow in a new terminal with: 'tail -f raspiblitz.provision-setup.log'" >> $logFile
|
||||
sed -i "s/^message=.*/message='Provision Setup'/g" ${infoFile}
|
||||
/home/admin/_cache.sh set message "Provision Setup"
|
||||
/home/admin/_provision.setup.sh
|
||||
errorState=$?
|
||||
sudo cat /home/admin/raspiblitz.provision-setup.log
|
||||
@ -641,7 +641,7 @@ if [ ${isMounted} -eq 0 ]; then
|
||||
# if migration from other nodes - run the migration provision first
|
||||
if [ "${setupPhase}" == "migration" ]; then
|
||||
echo "Calling _provision.migration.sh for possible migrations .." >> $logFile
|
||||
sed -i "s/^message=.*/message='Provision migration'/g" ${infoFile}
|
||||
/home/admin/_cache.sh set message "Provision migration"
|
||||
/home/admin/_provision.migration.sh
|
||||
errorState=$?
|
||||
cat /home/admin/raspiblitz.provision-migration.log
|
||||
@ -659,7 +659,7 @@ if [ ${isMounted} -eq 0 ]; then
|
||||
if [ "${setupPhase}" == "update" ] || [ "${setupPhase}" == "recovery" ] || [ "${setupPhase}" == "migration" ]; then
|
||||
echo "Calling _provision.update.sh .." >> $logFile
|
||||
echo "Follow in a new terminal with: 'tail -f raspiblitz.provision-update.log'" >> $logFile
|
||||
sed -i "s/^message=.*/message='Provision Update/Recovery/Migration'/g" ${infoFile}
|
||||
/home/admin/_cache.sh set message "Provision Update/Recovery/Migration"
|
||||
/home/admin/_provision.update.sh
|
||||
errorState=$?
|
||||
cat /home/admin/raspiblitz.provision-update.log
|
||||
@ -675,7 +675,7 @@ if [ ${isMounted} -eq 0 ]; then
|
||||
|
||||
# finalize provisioning
|
||||
echo "Calling _bootstrap.provision.sh for general system provisioning (${setupPhase}) .." >> $logFile
|
||||
sed -i "s/^message=.*/message='Provision Basics'/g" ${infoFile}
|
||||
/home/admin/_cache.sh set message "Provision Basics"
|
||||
/home/admin/_provision_.sh
|
||||
errorState=$?
|
||||
if [ "$errorState" != "0" ]; then
|
||||
|
@ -111,7 +111,7 @@ fi
|
||||
# start network service
|
||||
echo ""
|
||||
echo "*** Start ${network} (SETUP) ***" >> ${logFile}
|
||||
sed -i "s/^message=.*/message='Blockchain Testrun'/g" ${infoFile}
|
||||
/home/admin/_cache.sh set message "Blockchain Testrun"
|
||||
echo "- This can take a while .." >> ${logFile}
|
||||
cp /home/admin/assets/${network}d.service /etc/systemd/system/${network}d.service
|
||||
systemctl enable ${network}d.service
|
||||
|
@ -574,7 +574,7 @@ fi
|
||||
# JoinMarket Web UI
|
||||
if [ "${joinmarketWebUI}" = "on" ]; then
|
||||
echo "Provisioning JoinMarket Web UI - run config script" >> ${logFile}
|
||||
sudo sed -i "s/^message=.*/message='Setup JoinMarket Web UI'/g" ${infoFile}
|
||||
/home/admin/_cache.sh set message "Setup JoinMarket Web UI"
|
||||
sudo /home/admin/config.scripts/bonus.joinmarket-webui.sh on >> ${logFile} 2>&1
|
||||
else
|
||||
echo "Provisioning JoinMarket Web UI - keep default" >> ${logFile}
|
||||
@ -691,7 +691,7 @@ fi
|
||||
# helipad
|
||||
if [ "${helipad}" = "on" ]; then
|
||||
echo "Helipad - run config script" >> ${logFile}
|
||||
sudo sed -i "s/^message=.*/message='Setup Helipad'/g" ${infoFile}
|
||||
/home/admin/_cache.sh set message "Setup Helipad"
|
||||
sudo -u admin /home/admin/config.scripts/bonus.helipad.sh on >> ${logFile} 2>&1
|
||||
else
|
||||
echo "Helipad - keep default" >> ${logFile}
|
||||
|
@ -77,8 +77,8 @@ if [ "$1" = "target" ]; then
|
||||
esac
|
||||
|
||||
# setting copy state
|
||||
sed -i "s/^state=.*/state=copytarget/g" /home/admin/raspiblitz.info
|
||||
sed -i "s/^message=.*/message='Receiving Blockchain over LAN'/g" /home/admin/raspiblitz.info
|
||||
/home/admin/_cache.sh set state "copytarget"
|
||||
/home/admin/_cache.sh set message "Receiving Blockchain over LAN"
|
||||
|
||||
echo "stopping services ..."
|
||||
sudo systemctl stop lnd 2>/dev/null
|
||||
@ -289,8 +289,8 @@ if [ "$1" = "target" ]; then
|
||||
sleep 10
|
||||
|
||||
# setting copy state
|
||||
sed -i "s/^state=.*/state=ready/g" /home/admin/raspiblitz.info
|
||||
sed -i "s/^message=.*/message='Node Running'/g" /home/admin/raspiblitz.info
|
||||
/home/admin/_cache.sh set state "ready"
|
||||
/home/admin/_cache.sh set message "Node Running"
|
||||
fi
|
||||
|
||||
###################
|
||||
|
Loading…
Reference in New Issue
Block a user