From 1a6944bf3d588536655f19a800867cbf1e4e62fa Mon Sep 17 00:00:00 2001 From: rootzoll Date: Wed, 12 Dec 2018 16:23:09 +0100 Subject: [PATCH] freshly recovered flag --- home.admin/00mainMenu.sh | 2 ++ home.admin/_bootstrap.sh | 15 ++++++++++++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/home.admin/00mainMenu.sh b/home.admin/00mainMenu.sh index 9b69639..7d03179 100755 --- a/home.admin/00mainMenu.sh +++ b/home.admin/00mainMenu.sh @@ -39,6 +39,8 @@ fi if [ "${state}" = "recovered" ]; then echo "System recovered - needs final user settings" ./20recoverDialog.sh + # remove flag that freshly recovered + sudo rm /home/admin/raspiblitz.recover.info exit 1 fi diff --git a/home.admin/_bootstrap.sh b/home.admin/_bootstrap.sh index d904a8a..5db0f5c 100644 --- a/home.admin/_bootstrap.sh +++ b/home.admin/_bootstrap.sh @@ -175,6 +175,8 @@ if [ ${hddIsAutoMounted} -eq 0 ]; then sed -i "s/^state=.*/state=recovered/g" ${infoFile} sed -i "s/^message=.*/message='Done Recover'/g" ${infoFile} echo "rebooting" >> $logFile + # set flag that system is freshly recovered and needs setup dialogs + echo "state=recovered" >> /home/admin/raspiblitz.recover.info # save log file for inspection before reboot cp $logFile /home/admin/raspiblitz.recover.log sudo shutdown -r now @@ -265,11 +267,22 @@ if [ ${configExists} -eq 1 ]; then fi +################################ +# DETECT FRESHLY RECOVERED SD +################################ + +recoveredInfoExists=$(ls /home/admin/raspiblitz.recover.info | grep -c '.info') +if [ ${configExists} -eq 1 ]; then + sed -i "s/^state=.*/state=recovered/g" ${infoFile} + sed -i "s/^message=.*/message='login to finish'/g" ${infoFile} + exit 0 +fi + ################################ # SD INFOFILE BASICS ################################ -sed -i "s/^state=.*/state=ready/g" ${infoFile} +sed -i "s/^state=.*/state=recovered/g" ${infoFile} sed -i "s/^message=.*/message='waiting login'/g" ${infoFile} echo "DONE BOOTSTRAP" >> $logFile exit 0 \ No newline at end of file