Respawn instead of reboot if script fails

This commit is contained in:
Joshua Boniface 2023-09-01 15:41:58 -04:00
parent b2e3df099e
commit 5cfe70d021
1 changed files with 4 additions and 3 deletions

View File

@ -118,9 +118,9 @@ cleanup() {
if [[ -z ${DONE} ]]; then if [[ -z ${DONE} ]]; then
case ${install_option} in case ${install_option} in
on) on)
echo "A fatal error occurred; rebooting in 30 seconds. Press any key to spawn a shell." echo "A fatal error occurred!; restarting installer in 15 seconds. Press any key to spawn a shell."
if ! read -t 30; then if ! read -t 15; then
reboot exec ${0}
fi fi
;; ;;
*) *)
@ -967,6 +967,7 @@ DONE="y"
seed_postinst() { seed_postinst() {
cleanup cleanup
echo "Temporary root password: ${root_password}" echo "Temporary root password: ${root_password}"
echo
seed_checkin end seed_checkin end
echo "Rebooting in 10 seconds." echo "Rebooting in 10 seconds."