mirror of
https://github.com/rootzoll/raspiblitz.git
synced 2024-11-19 01:40:16 +01: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
|
||||
#echo "# controlFinalDialog.sh"
|
||||
/home/admin/setup.scripts/controlFinalDialog.sh
|
||||
# exit for final setup reboot
|
||||
state="reboot"
|
||||
# exit because controller will reboot at the end
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# exit loop/script in case if system shutting down
|
||||
@ -185,14 +185,12 @@ do
|
||||
echo "RaspiBlitz going to ${state}"
|
||||
echo "***********************************************************"
|
||||
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 admin@${localip}"
|
||||
echo "Use your password A"
|
||||
echo "***********************************************************"
|
||||
fi
|
||||
sleep 10
|
||||
exit 0
|
||||
fi
|
||||
|
||||
|
@ -706,66 +706,16 @@ if [ ${isMounted} -eq 0 ]; then
|
||||
done
|
||||
|
||||
###################################################
|
||||
# WAIT LOOP: AFTER FRESH SETUP, MIGRATION
|
||||
# successfull update & recover can skip this
|
||||
# HANDOVER TO FINAL SETUP CONTROLLER
|
||||
###################################################
|
||||
|
||||
if [ "${setupPhase}" == "setup" ] || [ "${setupPhase}" == "migration" ]; then
|
||||
echo "# Go into WAIT LOOP for final setup dialog ..." >> $logFile
|
||||
sed -i "s/^state=.*/state=waitfinal/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
|
||||
echo "# HANDOVER TO FINAL SETUP CONTROLLER ..." >> $logFile
|
||||
sed -i "s/^state=.*/state=waitfinal/g" ${infoFile}
|
||||
sed -i "s/^message=.*/message='Setup Done'/g" ${infoFile}
|
||||
|
||||
source ${infoFile}
|
||||
echo "WAIT LOOP: FINAL SETUP .. see controlFinalDialog.sh network(${network})" >> $logFile
|
||||
until [ "${state}" == "ready" ]
|
||||
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
|
||||
# system has to wait before reboot to present like seed words and other info/options to user
|
||||
echo "BOOTSTRAP EXIT ... waiting for final setup controller to initiate final reboot." >> $logFile
|
||||
exit 1
|
||||
|
||||
else
|
||||
|
||||
|
@ -104,28 +104,64 @@ if [ "${setupPhase}" == "setup" ]; then
|
||||
clear
|
||||
whiptail --title " Setup Done " --msgbox "\
|
||||
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
|
||||
" 12 65
|
||||
" 13 65
|
||||
|
||||
# when coming from migration from other node
|
||||
elif [ "${setupPhase}" == "migration" ]; then
|
||||
clear
|
||||
whiptail --title " Migration Done " --msgbox "\
|
||||
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
|
||||
" 12 65
|
||||
" 13 65
|
||||
|
||||
# just in case then from another phase
|
||||
else
|
||||
clear
|
||||
echo "Missing Final Done Dialog for: ${setupPhase}"
|
||||
echo "PRESS ENTER"
|
||||
read key
|
||||
whiptail --title " Recovery/Update Done " --msgbox "\
|
||||
Your RaspiBlitz is now ready again :D\n
|
||||
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
|
||||
|
||||
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