Files
proxmox/scripts/restart-wsl.sh
defiQUG dbd517b279 Sync workspace: config, docs, scripts, CI, operator rules, and submodule pointers.
- Update dbis_core, cross-chain-pmm-lps, explorer-monorepo, metamask-integration, pr-workspace/chains
- Omit embedded publish git dirs and empty placeholders from index

Made-with: Cursor
2026-04-12 06:12:20 -07:00

36 lines
1019 B
Bash
Executable File

#!/usr/bin/env bash
set -euo pipefail
# Script to restart WSL from Windows
# Usage: Run this from Windows PowerShell: wsl bash ~/projects/proxmox/scripts/restart-wsl.sh
echo "=========================================="
echo "WSL Restart Script"
echo "=========================================="
echo ""
echo "This script will restart WSL."
echo "You can run it from Windows PowerShell with:"
echo " wsl --shutdown"
echo ""
echo "Or restart just Ubuntu with:"
echo " wsl --terminate Ubuntu"
echo ""
echo "After restart, WSL will reconnect automatically."
echo ""
WSL_EXE="wsl.exe"
if ! command -v "$WSL_EXE" >/dev/null 2>&1 && [ -x /mnt/c/Windows/System32/wsl.exe ]; then
WSL_EXE="/mnt/c/Windows/System32/wsl.exe"
fi
run_wsl() {
"$WSL_EXE" "$@" 2>/dev/null | tr -d '\000' | sed 's/\r$//'
}
echo "Current WSL status:"
run_wsl --list --verbose || echo "Cannot check WSL status from within WSL"
echo ""
echo "To restart, run from Windows PowerShell (as Administrator if needed):"
echo " wsl --shutdown"
echo ""