fix: simplify and fix pwnagotchi-launcher logic #477
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Signed-off-by: Jeremy O'Brien neutral@fastmail.com
Self-explanatory
Description
It appears as though the launcher is broken right now. pi0 is always booting into manual mode regardless of network state.
Motivation and Context
It looks like the line that checks for a carrier on eth0 (for pi{1,2,3,4}) will evaluate to the same result as detecting a carrier when the interface doesn't exist (like on the pi0). By inverting the logic, we enter auto mode in both the case where the interface is present without a carrier (grep failure) and when the interface isn't present at all (grep failure).
I also simplified the logic flow a little to avoid nested if's.
[BUG] Launcher should check for eth0 before grepping #473
How Has This Been Tested?
maxxer on slack tested by observing that the pi0 always boots into manual mode without this change, but properly boots into auto mode when appropriate when this change is applied.
Types of changes
Checklist:
git commit -s