tbot icon indicating copy to clipboard operation
tbot copied to clipboard

linux.util: Fix wait_for_shell hang

Open surajkrishnan14 opened this issue 2 years ago • 0 comments

This change modifies tbot's wait_for_shell() to evaluate simple math instead of the existing echo TBOT''LOGIN. If a portion of the previously used echo command is dropped (including one single quote character but not both), then the shell interprets the command to be a multiline command. All subsequent retries of the echo command are then interpreted as part of the command, instead of new commands, and this loop essentially continues forever.

Using expr 41 + 1 and expecting 42 achieves the same objective of determining if the shell is ready but is protected against dropped characters resulting in an infinite loop.

surajkrishnan14 avatar Sep 28 '22 20:09 surajkrishnan14