/
Muvz82
/
openbox-linux
Обзор
Документация
Войти
/
Muvz82
/
openbox-linux
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
master
scripts/reset-dev-vm.sh
34 строки
699 B
Mikhail Sviridov
init
18 май 2026, 17:54
18 май 2026, 17:54
482974b
Код
Авторство
О чём код?
#!/bin/bash # OpenWinBox — Reset dev VM (destroy + undefine + recreate disk) set -euo pipefail VM_NAME="${1:-openwinbox-win}" echo "=== OpenWinBox — Reset Dev VM ===" echo "VM: $VM_NAME" echo "" echo "WARNING: This will destroy and undefine the VM!" read -p "Continue? [y/N] " confirm if [ "$confirm" != "y" ] && [ "$confirm" != "Y" ]; then echo "Cancelled." exit 0 fi echo "" # Destroy if running if virsh domstate "$VM_NAME" 2>/dev/null | grep -q "running"; then echo "Destroying running VM..." virsh destroy "$VM_NAME" fi # Undefine if virsh dominfo "$VM_NAME" &>/dev/null; then echo "Undefining VM..." virsh undefine "$VM_NAME" fi echo "" echo "=== VM reset complete ==="