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

#770: Less VPN shell text Fix mv folder with space #792

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 7 additions & 12 deletions scripts/src/main/resources/scripts/command/docker
Original file line number Diff line number Diff line change
Expand Up @@ -159,26 +159,21 @@ function doInstallVpnkit() {
local downloadUrl="https://github.com/sakai135/wsl-vpnkit/releases/download/${VPNversion}/wsl-vpnkit.tar.gz"
curl -fL "${downloadUrl}" -o "wsl-vpnkit.tar.gz"

#at first write a bash-script
{
echo '#!/bin/sh'
echo 'wsl.exe -d wsl-vpnkit service wsl-vpnkit start'
} > activate-vpnkit
#now write a pwsh-script which also executes the above bash-script in WSL
#go to needed path by using pushd to be able to get back easily with popd for running the above bash script
#write a powershell-script
#go to an actual windows path for the powershell command by using pushd to be able to get back easily with popd
#execute command to start wsl-vpnkit
# shellcheck disable=SC1083,SC2129,SC2016
{
echo 'mv -f wsl-vpnkit.tar.gz $env:USERPROFILE'
echo 'mv -Force wsl-vpnkit.tar.gz $env:USERPROFILE\wsl-vpnkit.tar.gz'
hohwille marked this conversation as resolved.
Show resolved Hide resolved
echo 'pushd $env:USERPROFILE'
echo 'wsl --import wsl-vpnkit $env:USERPROFILE\wsl-vpnkit wsl-vpnkit.tar.gz --version 2'
echo 'wsl -d wsl-vpnkit'
echo 'popd'
echo 'wsl.exe sh activate-vpnkit'
echo 'wsl.exe -d wsl-vpnkit service wsl-vpnkit start'
} > vpnkit-setup.ps1

#execute the powershell-script directly and the script for inside wsl indirectly
#execute the powershell-script
powershell.exe -Command ".\vpnkit-setup.ps1"
rm activate-vpnkit vpnkit-setup.ps1
rm vpnkit-setup.ps1
}


Expand Down
2 changes: 1 addition & 1 deletion scripts/src/main/resources/scripts/functions
Original file line number Diff line number Diff line change
Expand Up @@ -701,7 +701,7 @@ function doExtract() {
fi
elif doIsInstallerExtension "${filename}"
then
doRunCommand "mv ${1} ${target_dir}"
doRunCommand "mv \"${1}\" \"${target_dir}\""
else
doFail "Unknown archive format: ${ext}. Can not extract ${1}"
fi
Expand Down