shutdown on network remove during setup

This commit is contained in:
rootzoll
2021-08-18 21:24:18 +02:00
parent 658a30db5a
commit 09091252ff
2 changed files with 20 additions and 1 deletions

View File

@@ -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

View File

@@ -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')