From 09091252ff41fe285e65593353f82b4fa37da436 Mon Sep 17 00:00:00 2001 From: rootzoll Date: Wed, 18 Aug 2021 21:24:18 +0200 Subject: [PATCH] shutdown on network remove during setup --- home.admin/_bootstrap.sh | 13 ++++++++++++- home.admin/setup.scripts/eventInfoWait.sh | 8 ++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/home.admin/_bootstrap.sh b/home.admin/_bootstrap.sh index 960bfbf3b..a2085574a 100755 --- a/home.admin/_bootstrap.sh +++ b/home.admin/_bootstrap.sh @@ -433,7 +433,18 @@ if [ ${isMounted} -eq 0 ]; then sed -i "s/^state=.*/state=errorHDD/g" ${infoFile} sed -i "s/^message=.*/message='lost HDD - rebooting'/g" ${infoFile} sudo cp ${logFile} ${logFile}.error - sleep 6 + sleep 3 + sudo shutdown -r now + sleep 100 + exit 0 + fi + + # detect if network get deconnected again + # --> "removing network cable" can be used as signal to shutdown clean on test startup + source <(/home/admin/config.scripts/internet.sh status) + if [ "${localip}" == "" ]; then + sed -i "s/^state=.*/state=errorNetwork/g" ${infoFile} + sleep 3 sudo shutdown -r now sleep 100 exit 0 diff --git a/home.admin/setup.scripts/eventInfoWait.sh b/home.admin/setup.scripts/eventInfoWait.sh index 05fa4714e..9e9818ad6 100644 --- a/home.admin/setup.scripts/eventInfoWait.sh +++ b/home.admin/setup.scripts/eventInfoWait.sh @@ -279,6 +279,14 @@ Detailed Error Message: ${contentString} " 7 35 +elif [ "${eventID}" == "errorNetwork" ]; then + + dialog --backtitle "${backtitle}" --cr-wrap --infobox " +PROBLEM: LOST NETWORK +Shutting down ... +Manual restart needed. +" 7 35 + elif [ "${eventID}" == "sdtoosmall" ]; then # contentWords[0] --> size string (for example '16GB')