wsl: make creating new user optional
This commit is contained in:
parent
5b04867bc8
commit
496d67c9c3
1 changed files with 3 additions and 3 deletions
|
@ -1,8 +1,8 @@
|
|||
@echo off
|
||||
if not "%~1"=="" if not "%~2"=="" if not "%~3"=="" if not "%~4"=="" goto :run
|
||||
echo Arguments: ^<filesystem.tar.gz^> ^<destination directory^> ^<distribution name^> ^<user name^>
|
||||
if not "%~1"=="" if not "%~2"=="" if not "%~3"=="" goto :run
|
||||
echo Arguments: ^<filesystem.tar.gz^> ^<destination directory^> ^<distribution name^> [user name]
|
||||
exit /b 1
|
||||
:run
|
||||
wsl.exe --import %~3 "%~2" "%~1" --version 2
|
||||
wsl.exe --distribution %~3 -- adduser %~4; adduser %~4 sudo; echo $'[user]\n\tdefault = %~4' ^> /etc/wsl.conf; chmod 644 /etc/wsl.conf
|
||||
if not "%~4"=="" wsl.exe --distribution %~3 -- adduser %~4; adduser %~4 sudo; echo $'[user]\n\tdefault = %~4' ^> /etc/wsl.conf; chmod 644 /etc/wsl.conf
|
||||
wsl.exe --terminate %~3
|
||||
|
|
Loading…
Add table
Reference in a new issue