mviereck / runx

Provide X server on MS Windows with cookie authentication.
MIT License
87 stars 14 forks source link

When on WSL2, check for internal host IP #11

Closed RolandRosier closed 1 year ago

RolandRosier commented 1 year ago

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 commented 1 year ago

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

RolandRosier commented 1 year ago

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 commented 1 year ago

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

It also addresses issues #13 and #14 ,

mviereck commented 1 year ago

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.

RolandRosier commented 1 year ago

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.