mirror of
https://github.com/Retropex/raspiblitz.git
synced 2025-05-12 19:20:48 +02:00
#2600 move final rebot into controller
This commit is contained in:
parent
cd41455a6d
commit
69d62a6929
@ -173,8 +173,8 @@ do
|
|||||||
# push to final setup gui dialogs
|
# push to final setup gui dialogs
|
||||||
#echo "# controlFinalDialog.sh"
|
#echo "# controlFinalDialog.sh"
|
||||||
/home/admin/setup.scripts/controlFinalDialog.sh
|
/home/admin/setup.scripts/controlFinalDialog.sh
|
||||||
# exit for final setup reboot
|
# exit because controller will reboot at the end
|
||||||
state="reboot"
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# exit loop/script in case if system shutting down
|
# exit loop/script in case if system shutting down
|
||||||
@ -185,14 +185,12 @@ do
|
|||||||
echo "RaspiBlitz going to ${state}"
|
echo "RaspiBlitz going to ${state}"
|
||||||
echo "***********************************************************"
|
echo "***********************************************************"
|
||||||
if [ "${state}" == "reboot" ]; then
|
if [ "${state}" == "reboot" ]; then
|
||||||
if [ "${message}" == "finalsetup" ]; then
|
|
||||||
echo "This is the final setup reboot - you will get disconnected."
|
|
||||||
fi
|
|
||||||
echo "SSH again into system with:"
|
echo "SSH again into system with:"
|
||||||
echo "ssh admin@${localip}"
|
echo "ssh admin@${localip}"
|
||||||
echo "Use your password A"
|
echo "Use your password A"
|
||||||
echo "***********************************************************"
|
echo "***********************************************************"
|
||||||
fi
|
fi
|
||||||
|
sleep 10
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -706,66 +706,16 @@ if [ ${isMounted} -eq 0 ]; then
|
|||||||
done
|
done
|
||||||
|
|
||||||
###################################################
|
###################################################
|
||||||
# WAIT LOOP: AFTER FRESH SETUP, MIGRATION
|
# HANDOVER TO FINAL SETUP CONTROLLER
|
||||||
# successfull update & recover can skip this
|
|
||||||
###################################################
|
###################################################
|
||||||
|
|
||||||
if [ "${setupPhase}" == "setup" ] || [ "${setupPhase}" == "migration" ]; then
|
echo "# HANDOVER TO FINAL SETUP CONTROLLER ..." >> $logFile
|
||||||
echo "# Go into WAIT LOOP for final setup dialog ..." >> $logFile
|
|
||||||
sed -i "s/^state=.*/state=waitfinal/g" ${infoFile}
|
sed -i "s/^state=.*/state=waitfinal/g" ${infoFile}
|
||||||
sed -i "s/^message=.*/message='Setup Done'/g" ${infoFile}
|
sed -i "s/^message=.*/message='Setup Done'/g" ${infoFile}
|
||||||
else
|
|
||||||
echo "# Skip WAIT LOOP boot directly into main menu ..." >> $logFile
|
|
||||||
sed -i "s/^state=.*/state=ready/g" ${infoFile}
|
|
||||||
sed -i "s/^message=.*/message='Setup Done'/g" ${infoFile}
|
|
||||||
fi
|
|
||||||
|
|
||||||
source ${infoFile}
|
# system has to wait before reboot to present like seed words and other info/options to user
|
||||||
echo "WAIT LOOP: FINAL SETUP .. see controlFinalDialog.sh network(${network})" >> $logFile
|
echo "BOOTSTRAP EXIT ... waiting for final setup controller to initiate final reboot." >> $logFile
|
||||||
until [ "${state}" == "ready" ]
|
exit 1
|
||||||
do
|
|
||||||
|
|
||||||
# get latest network info & update raspiblitz.info (in case network changes)
|
|
||||||
source <(/home/admin/config.scripts/internet.sh status)
|
|
||||||
sed -i "s/^localip=.*/localip='${localip}'/g" ${infoFile}
|
|
||||||
|
|
||||||
# give the loop a little bed time
|
|
||||||
sleep 4
|
|
||||||
|
|
||||||
# check info file for updated values
|
|
||||||
# especially the state for checking loop
|
|
||||||
source ${infoFile}
|
|
||||||
|
|
||||||
done
|
|
||||||
echo "WAIT LOOP: DONE" >> $logFile
|
|
||||||
|
|
||||||
########################################
|
|
||||||
# AFTER FINAL SETUP TASKS
|
|
||||||
|
|
||||||
# make sure for future starts that blockchain service gets started after bootstrap
|
|
||||||
# so deamon reloas needed ... system will go into reboot after last loop
|
|
||||||
# needs to be after wait loop because otherwise the "restart" on COPY OVER LAN will not work
|
|
||||||
echo "# Updating service ${network}d.service ..." >> $logFile
|
|
||||||
sudo sed -i "s/^Wants=.*/Wants=bootstrap.service/g" /etc/systemd/system/${network}d.service
|
|
||||||
sudo sed -i "s/^After=.*/After=bootstrap.service/g" /etc/systemd/system/${network}d.service
|
|
||||||
sudo systemctl daemon-reload
|
|
||||||
|
|
||||||
# delete setup data from RAM
|
|
||||||
sudo rm ${setupFile}
|
|
||||||
|
|
||||||
# signal that setup phase is over
|
|
||||||
sed -i "s/^setupPhase=.*/setupPhase='done'/g" ${infoFile}
|
|
||||||
|
|
||||||
########################################
|
|
||||||
# AFTER SETUP REBOOT
|
|
||||||
# touchscreen activation, start with configured SWAP, fix LCD text bug
|
|
||||||
sudo cp /home/admin/raspiblitz.log /home/admin/raspiblitz.setup.log
|
|
||||||
timeout 60 /home/admin/config.scripts/blitz.shutdown.sh reboot finalsetup
|
|
||||||
sleep 10
|
|
||||||
# if system has not rebooted yet - force reboot directly
|
|
||||||
sudo shutdown -r now
|
|
||||||
sleep 60
|
|
||||||
exit 0
|
|
||||||
|
|
||||||
else
|
else
|
||||||
|
|
||||||
|
@ -104,28 +104,64 @@ if [ "${setupPhase}" == "setup" ]; then
|
|||||||
clear
|
clear
|
||||||
whiptail --title " Setup Done " --msgbox "\
|
whiptail --title " Setup Done " --msgbox "\
|
||||||
Your RaspiBlitz setup is done. Welcome new Node Operator! :D\n
|
Your RaspiBlitz setup is done. Welcome new Node Operator! :D\n
|
||||||
There can be some waiting time until your blockchain is fully synced before you can enter the RaspiBlitz user menu.\n
|
After the final reboot there can be some waiting time until your blockchain is fully synced before you can enter the RaspiBlitz user menu.\n
|
||||||
It is safe to log out during the sync and return later.\n
|
It is safe to log out during the sync and return later.\n
|
||||||
" 12 65
|
" 13 65
|
||||||
|
|
||||||
# when coming from migration from other node
|
# when coming from migration from other node
|
||||||
elif [ "${setupPhase}" == "migration" ]; then
|
elif [ "${setupPhase}" == "migration" ]; then
|
||||||
clear
|
clear
|
||||||
whiptail --title " Migration Done " --msgbox "\
|
whiptail --title " Migration Done " --msgbox "\
|
||||||
Your running now RaspiBlitz. Welcome to the family! :D\n
|
Your running now RaspiBlitz. Welcome to the family! :D\n
|
||||||
There might now be some waiting time until your Blockchain is fully synced before you can enter the RaspiBlitz user menu.\n
|
After the final reboot there might now be some waiting time until your Blockchain is fully synced before you can enter the RaspiBlitz user menu.\n
|
||||||
Its safe to logout during sync and return later.\n
|
Its safe to logout during sync and return later.\n
|
||||||
" 12 65
|
" 13 65
|
||||||
|
|
||||||
# just in case then from another phase
|
# just in case then from another phase
|
||||||
else
|
else
|
||||||
clear
|
clear
|
||||||
echo "Missing Final Done Dialog for: ${setupPhase}"
|
whiptail --title " Recovery/Update Done " --msgbox "\
|
||||||
echo "PRESS ENTER"
|
Your RaspiBlitz is now ready again :D\n
|
||||||
read key
|
After the final reboot there might now be some waiting time until your Blockchain sync has catched up before you can enter the RaspiBlitz user menu.\n
|
||||||
|
" 11 65
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "Starting ... (please wait)"
|
# source info fresh
|
||||||
|
source /home/admin/raspiblitz.info
|
||||||
|
clear
|
||||||
|
echo "***********************************************************"
|
||||||
|
echo "RaspiBlitz going to reboot"
|
||||||
|
echo "***********************************************************"
|
||||||
|
echo "This is the final setup reboot - you will get disconnected."
|
||||||
|
echo "SSH again into system with:"
|
||||||
|
echo "ssh admin@${localip}"
|
||||||
|
echo "Use your password A"
|
||||||
|
echo "***********************************************************"
|
||||||
|
|
||||||
# signal to backend that all is good and it can continue
|
########################################
|
||||||
sudo sed -i "s/^state=.*/state='ready'/g" /home/admin/raspiblitz.info
|
# AFTER FINAL SETUP TASKS
|
||||||
|
|
||||||
|
# make sure for future starts that blockchain service gets started after bootstrap
|
||||||
|
# so deamon reloas needed ... system will go into reboot after last loop
|
||||||
|
# needs to be after wait loop because otherwise the "restart" on COPY OVER LAN will not work
|
||||||
|
echo "# Updating service ${network}d.service ..." >> $logFile
|
||||||
|
sudo sed -i "s/^Wants=.*/Wants=bootstrap.service/g" /etc/systemd/system/${network}d.service
|
||||||
|
sudo sed -i "s/^After=.*/After=bootstrap.service/g" /etc/systemd/system/${network}d.service
|
||||||
|
sudo systemctl daemon-reload
|
||||||
|
|
||||||
|
# delete setup data from RAM
|
||||||
|
sudo rm ${setupFile}
|
||||||
|
|
||||||
|
# signal that setup phase is over
|
||||||
|
sed -i "s/^setupPhase=.*/setupPhase='done'/g" ${infoFile}
|
||||||
|
|
||||||
|
########################################
|
||||||
|
# AFTER SETUP REBOOT
|
||||||
|
# touchscreen activation, start with configured SWAP, fix LCD text bug
|
||||||
|
sudo cp /home/admin/raspiblitz.log /home/admin/raspiblitz.setup.log
|
||||||
|
timeout 120 /home/admin/config.scripts/blitz.shutdown.sh reboot finalsetup
|
||||||
|
# if system has not rebooted yet - force reboot directly
|
||||||
|
sudo shutdown -r now
|
||||||
|
sleep 120
|
||||||
|
echo "FAIL: automatic final reboot didnt worked .. please report to dev team and try to reboot manually"
|
||||||
|
exit 0
|
Binary file not shown.
Before Width: | Height: | Size: 19 KiB After Width: | Height: | Size: 20 KiB |
Loading…
Reference in New Issue
Block a user