Skip to content

Commit

Permalink
setup-teslausb: fix terminal detection for upgrade
Browse files Browse the repository at this point in the history
setup-teslausb's stdin was set to /dev/null on upgrade, which would
bypass some of the interactive prompts.
  • Loading branch information
marcone committed Oct 31, 2023
1 parent eac41ee commit 8668a24
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions setup/pi/setup-teslausb
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ fi

if [ "$REBOOT" = "true" ]
then
if [ -t 0 ]
if [ -t 0 ] && [ "${NO_REBOOT_PROMPT:-}" != "1" ]
then
setup_progress "please reboot for changes to take effect"
exit
Expand Down Expand Up @@ -498,7 +498,7 @@ function cmd_upgrade {
fi
copy_script setup/pi/setup-teslausb /tmp &> /dev/null
copy_script setup/pi/envsetup.sh /tmp &> /dev/null
exec bash -c "/tmp/setup-teslausb upgrade_prepare && /tmp/setup-teslausb && /tmp/setup-teslausb upgrade_finish" < /dev/null
exec bash -c "/tmp/setup-teslausb upgrade_prepare && NO_REBOOT_PROMPT=1 /tmp/setup-teslausb && /tmp/setup-teslausb upgrade_finish"
}

function cmd_upgrade_prepare {
Expand Down Expand Up @@ -958,7 +958,7 @@ headless_setup_progress_flash 5

setup_progress "All done."

if [ -t 0 ]
if [ -t 0 ] && [ "${NO_REBOOT_PROMPT:-}" != "1" ]
then
setup_progress '(reboot now for changes to take effect)'
fi

0 comments on commit 8668a24

Please sign in to comment.