Differences
This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
| virtualbox_scripts [22 January 2026 / 14:37:04] – created kadek | virtualbox_scripts [22 January 2026 / 14:43:23] (current) – kadek | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | ==== VirtualBox Scripts ==== | + | ===== VirtualBox Scripts |
| === Script for Check & Start VM === | === Script for Check & Start VM === | ||
| + | |||
| This script will check VM status and start inactive VM: | This script will check VM status and start inactive VM: | ||
| Line 7: | Line 8: | ||
| #!/bin/bash | #!/bin/bash | ||
| | | ||
| - | # List of VirtualBox VM names | + | |
| - | VM_NAMES=(" | + | VM_NAMES=(" |
| - | echo "==== VirtualBox VM Checker ====" | + | echo "==== VirtualBox VM Checker ====" |
| - | echo "==== Script from KdeK.One ====" | + | echo "==== Script from KdeK.One ====" |
| - | for NAME in " | + | for NAME in " |
| - | # Check if VM exists | + | |
| - | EXISTS=$(VBoxManage list vms | grep -w " | + | |
| - | if [ -z " | + | |
| echo " | echo " | ||
| continue | continue | ||
| - | | + | fi |
| | | ||
| - | | + | # Check if VM is running |
| - | RUNNING=$(VBoxManage list runningvms | grep -w " | + | |
| | | ||
| - | | + | if [ -n " |
| echo "[OK] VM ' | echo "[OK] VM ' | ||
| - | | + | else |
| echo " | echo " | ||
| VBoxManage startvm " | VBoxManage startvm " | ||
| Line 35: | Line 36: | ||
| echo " | echo " | ||
| fi | fi | ||
| - | | + | fi |
| - | done | + | done |
| - | echo "==== Done ====" | + | echo "==== Done ====" |
