Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When on WSL2, check for internal host IP #11

Merged
merged 2 commits into from
Jan 13, 2023

Conversation

RolandRosier
Copy link
Contributor

Added line to check for the internal host IP before checking the external IP addresses.

Also now parse the options before calling check_host, so that any passed in options can be used in the check_host function.

Added line to check for the internal host IP before checking the
external IP addresses.

Also now parse the options before calling check_host, so that any passed
in options can be used in the check_host function.
@RolandRosier
Copy link
Contributor Author

Noticed that the -h option no longer exits immediately, so this needs reconsidering.

@RolandRosier
Copy link
Contributor Author

Moved detection of sourced mode into parse_options, before the actual parsing of the options, so that it can be used as early as possible (sourcing the file instead of executing it is a type of option).

Removed the call of finish() from the --help option - because in sourced mode, it did not exit, but instead it unset all the variables and functions, which then caused errors as the rest of the script tried to execute them.

Made execution of the remaining steps in the script dependent on the $Exitcode variable being unset, so that these steps are not executed if --help is passed.

@RolandRosier
Copy link
Contributor Author

RolandRosier commented Jan 11, 2023

The primary purpose of this branch was to address issue #12 .

It also addresses issues #13 and #14 ,

@mviereck
Copy link
Owner

Thank you for your investigation and your fixes!
I have no test environment yet, so I'll rely on you that you have tested well.

@mviereck mviereck merged commit 6b28460 into mviereck:master Jan 13, 2023
@RolandRosier
Copy link
Contributor Author

Thank you for your investigation and your fixes! I have no test environment yet, so I'll rely on you that you have tested well.

Thank you for merging; I noted the lack of test environment (that could be a potential improvement), so I wasn't sure exactly how to test and what tests to do - and I only have a WSL2 environment and Ubuntu, so I can't check that MSYS2 works (for example).

But I did what I could think of.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants