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

Adapt the wsl-vpnkit, so it makes use of WSL_INTEROP variable #250

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 4 additions & 2 deletions wsl-vpnkit
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ command -v iptables-legacy >/dev/null && alias iptables=iptables-legacy

run () {
echo "starting vm and gvproxy..."
printenv
dabeck81 marked this conversation as resolved.
Show resolved Hide resolved
$VMEXEC_PATH \
-url="stdio:$GVPROXY_PATH?listen-stdio=accept&debug=$DEBUG" \
-iface="$TAP_NAME" \
Expand Down Expand Up @@ -134,12 +135,13 @@ start () {
monitor () {
while true
do
if ss -elx | grep -q $WSL_INTEROP; then
if ss -elx | grep -q $WSL_INTEROP &&
[ $WSL_INTEROP = "/run/WSL/$(ls /run/WSL | sort -n | tail -n 1)" ]; then
: #everything is going well, socket still valid, no action to do
else
echo "Something is going bad, socket $WSL_INTEROP broken, trying to repair..."
echo "killing all subprcesses from this wsl-vpnkit-script"
pstree -A -p $$ | grep -Eow "[0-9]+" | tail -n +2 | xargs kill
pstree -p $$ | grep -Eow "[0-9]+" | tail -n +2 | xargs kill
echo "setting new Interop-variable"
export WSL_INTEROP="/run/WSL/$(ls /run/WSL | sort -n | tail -n 1)"
start
Expand Down