Files
wsl-tools/wsl-unmount
T
2026-09-05 02:13:35 +08:00

21 lines
392 B
Bash
Executable File

#!/bin/bash
APP_DIR="$(dirname "$0")"
WINDOWS_MOUNT="$APP_DIR/windows-mount"
WSL_INTEROP_READY="$APP_DIR/wsl-interop-ready"
WSL_PATH="$APP_DIR/wsl-path"
DRIVE="$1"
if ! $WINDOWS_MOUNT >/dev/null; then
echo "Error: Windows not mounted" >&2
exit 1
fi
if ! $WSL_INTEROP_READY; then
echo "Error: WSL Interop not found in /run/WSL" >&2
exit 1
fi
WSL="$($WSL_PATH)"
$WSL --unmount "$DRIVE"