diff --git a/home.admin/_bootstrap.sh b/home.admin/_bootstrap.sh index 5b4735db7..31d26b2b1 100755 --- a/home.admin/_bootstrap.sh +++ b/home.admin/_bootstrap.sh @@ -433,6 +433,10 @@ if [ ${isMounted} -eq 0 ]; then done + ############################################# + # PROVISION PROCESS + ############################################# + # temp mount the HDD echo "Temp mounting data drive ($hddCandidate)" >> $logFile if [ "${hddFormat}" != "btrfs" ]; then @@ -450,23 +454,46 @@ if [ ${isMounted} -eq 0 ]; then sed -i "s/^message=.*/message='Starting Provision'/g" ${infoFile} #sed -i "s/^chain=.*/chain=${chain}/g" ${infoFile} #sed -i "s/^network=.*/network=${network}/g" ${infoFile} - echo "Calling Data Migration .." >> $logFile + echo "Calling Data Migration for possible updates .." >> $logFile sudo /home/admin/_bootstrap.update.sh echo "Calling Provisioning .." >> $logFile sudo /home/admin/_bootstrap.provision.sh - sed -i "s/^state=.*/state=reboot/g" ${infoFile} + sed -i "s/^state=.*/state=waitfinal/g" ${infoFile} sed -i "s/^message=.*/message='Done Provision'/g" ${infoFile} # PROCESS raspiblitz.setup echo "TODO: After Provision Handling .." >> $logFile - # handle possible errors - # set passwords - # show seed words + ################################################### + # WAIT LOOP: AFTER FRESH SETUP, MIFGRATION OR ERROR + # successfull update & recover can skip this + ################################################### + + until [ "${state}" == "waitfinal" ] + do + + # TODO: DETECT WHEN USER SETUP IS DONE + echo "TODO: DETECT WHEN USER FINAL DIALOG IS DONE" >> $logFile + + # handle possible errors + # set passwords + # show seed words + + # 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 exit 0 - echo "rebooting" >> $logFile echo "state=recovered" >> /home/admin/recover.flag echo "shutdown in 1min" >> $logFile diff --git a/home.admin/setup.scripts/dialogBasicSetup.sh b/home.admin/setup.scripts/dialogBasicSetup.sh index 6a6b2fd7f..9c0a65b48 100644 --- a/home.admin/setup.scripts/dialogBasicSetup.sh +++ b/home.admin/setup.scripts/dialogBasicSetup.sh @@ -30,7 +30,7 @@ case $CHOICE in # 2 --> SHUTDOWN clear echo "Shutting down without changes ..." - echo "Cut power when you see no status LED action anymore." + echo "Cut power when you see no status LED blinking anymore." exit 2 ;; *) diff --git a/home.admin/setup.scripts/eventInfoWait.sh b/home.admin/setup.scripts/eventInfoWait.sh index 2d7c629e5..5013642ba 100644 --- a/home.admin/setup.scripts/eventInfoWait.sh +++ b/home.admin/setup.scripts/eventInfoWait.sh @@ -79,12 +79,26 @@ elif [ "${eventID}" == "waitsetup" ] && [ "${mode}" == "lcd" ]; then backtitle="${backtitle} / (pre-synced)" fi + # custom welcomeline for this dialog + welcomeline="Your RaspiBlitz is ready for Setup" + if [ "${setupPhase}" == "update" ]; then + welcomeline="RaspiBlitz is ready for Update" + fi + if [ "${setupPhase}" == "recovery" ]; then + welcomeline="RaspiBlitz is ready for Recovery" + fi + if [ "${setupPhase}" == "migration" ]; then + welcomeline="Ready for migration to RaspiBlitz" + fi + # show default login help info dialog --backtitle "${backtitle}" --cr-wrap --infobox " -Login to your RaspiBlitz with: +${welcomeline} +------------------------------------ +Use terminal command to login: ssh admin@${localip} -Use password: raspiblitz -" 7 41 +password: raspiblitz +" 9 41 else @@ -97,6 +111,14 @@ Use password: raspiblitz " 8 41 fi +elif [ "${eventID}" == "waitfinal" ]; then + + dialog --backtitle "${backtitle}" --cr-wrap --infobox " +Setup-Done - Login for Details: +ssh admin@${localip} +Use your Password A +" 7 41 + elif [ "${eventID}" == "shutdown" ]; then dialog --backtitle "${backtitle}" --cr-wrap --infobox "