11 lines
366 B
Bash
Executable File
11 lines
366 B
Bash
Executable File
#!/bin/bash
|
|
if [ $# = 1 ]; then
|
|
cmd="umount ${1@Q} && rmdir ${1@Q}"
|
|
elif [ $# = 2 ]; then
|
|
cmd="mkdir --parents ${2@Q} && mount --options uid=$(id --user),gid=$(id --group) --types drvfs ${1@Q} ${2@Q} || rmdir ${2@Q}"
|
|
else
|
|
>&2 echo 'Arguments: [<drive or share>] <directory>'
|
|
exit 1
|
|
fi
|
|
wsl.exe --distribution $WSL_DISTRO_NAME --user $(id --name --user 0) -- $cmd
|