Skip to content

Commit

Permalink
use wsl2 PATH integration (#40)
Browse files Browse the repository at this point in the history
  • Loading branch information
sakai135 authored Oct 4, 2021
1 parent ceb7473 commit 46a3601
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ cd wsl-vpnkit/
The `wsl-vpnkit` script can be used as a normal script in your existing distro. This is an example setup script for Ubuntu.

```sh
USERPROFILE=$(wslpath "$(/mnt/c/WINDOWS/System32/WindowsPowerShell/v1.0/powershell.exe -c '$env:USERPROFILE' | tr -d '\r')")
USERPROFILE=$(wslpath "$(powershell.exe -c '$env:USERPROFILE' | tr -d '\r')")
mkdir -p "$USERPROFILE/wsl-vpnkit"

sudo apt install p7zip-full socat
Expand Down
2 changes: 1 addition & 1 deletion distro/startup.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#! /bin/sh

LOG_PATH="/var/log/wsl-vpnkit.log"
USERPROFILE=$(wslpath "$(/mnt/c/WINDOWS/System32/WindowsPowerShell/v1.0/powershell.exe -c '$env:USERPROFILE' | tr -d '\r')")
USERPROFILE=$(wslpath "$(powershell.exe -c '$env:USERPROFILE' | tr -d '\r')")

touch $LOG_PATH

Expand Down
2 changes: 1 addition & 1 deletion distro/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# run from repo root
# ./distro/test.sh

USERPROFILE="$(/mnt/c/WINDOWS/System32/WindowsPowerShell/v1.0/powershell.exe -c '$env:USERPROFILE' | tr -d '\r')"
USERPROFILE="$(powershell.exe -c '$env:USERPROFILE' | tr -d '\r')"
DUMP=wsl-vpnkit.tar.gz
TAG_NAME=wslvpnkit

Expand Down
2 changes: 1 addition & 1 deletion distro/wsl-vpnkit.service
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ ret=0

start() {
# using `wsl.exe` allows the daemon to keep running in the background even when you close your terminal
/mnt/c/WINDOWS/system32/wsl.exe \
wsl.exe \
--user root \
--distribution $WSL_DISTRO_NAME \
-- \
Expand Down
2 changes: 1 addition & 1 deletion wsl-vpnkit
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#! /bin/sh

USERPROFILE=$(wslpath "$(/mnt/c/WINDOWS/System32/WindowsPowerShell/v1.0/powershell.exe -c '$env:USERPROFILE' | tr -d '\r')")
USERPROFILE=$(wslpath "$(powershell.exe -c '$env:USERPROFILE' | tr -d '\r')")
CONF_PATH="$USERPROFILE/wsl-vpnkit/wsl-vpnkit.conf"
SOCKET_PATH="/var/run/wsl-vpnkit.sock"
PIPE_PATH="//./pipe/wsl-vpnkit"
Expand Down

0 comments on commit 46a3601

Please sign in to comment.