2026-03-02 11:37:34 -08:00
|
|
|
#!/usr/bin/env bash
|
2026-02-12 15:46:57 -08:00
|
|
|
set -euo pipefail
|
|
|
|
|
|
2026-01-06 01:46:25 -08:00
|
|
|
# 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 ""
|
|
|
|
|
echo "Current WSL status:"
|
|
|
|
|
wsl.exe --list --verbose 2>/dev/null || echo "Cannot check WSL status from within WSL"
|
|
|
|
|
echo ""
|
|
|
|
|
echo "To restart, run from Windows PowerShell (as Administrator if needed):"
|
|
|
|
|
echo " wsl --shutdown"
|
|
|
|
|
echo ""
|
|
|
|
|
|