Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| virtualbox_scripts [22 January 2026 / 14:38:35] – 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 12: | Line 13: | ||
| 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 ====" | + | |
