Search
Project
General
Profile
Sign in
Register
Home
Projects
Help
Search
:
Create rc.d script to automatically start Byve vms & shut them down gracefully
All Projects
Outpost Internet Ltd
»
Create rc.d script to automatically start Byve vms & shut them down gracefully
Overview
Activity
Issues
Spent time
Gantt
Calendar
News
Documents
Wiki
Files
Download (764 Bytes)
Files
» stopvmsgracefully.sh
Sam Bracewell
, 13/04/2026 03:34 PM
#!/bin/sh
#
# Loop running vms to shutdown
# For each one, send the ACPI shutdown command
# Allow 2 mins for shutdown
# If still has not shut down, kill the Bhyve vm process
# Then destroy the vm
# Check if directory /dev/vmm exists.
vminstancedir
=
"/dev/vmm"
if
[
!
-d
"
$vminstancedir
"
]
then
echo
"Directory
$vminstancedir
not found. "
echo
"No Bhyve vms to shutdown. "
else
echo
"Directory
$vminstancedir
exists. "
for
FILE
in
/dev/vmm/
*
do
vmname
=
$(
echo
"
$FILE
"
|
cut
-d
/
-f4
)
echo
"
$vmname
"
sh /tank/myscripts/stopvmgracefully.sh
$vmname
&
done
fi
# for FILE in /dev/vmm/*
# do
# ddd=$(echo "$FILE" | cut -d/ -f4 )
#echo $ddd
# done
# guestname=$( echo "$line" | cut -f1 )
« Previous
1
…
7
8
9
10
Next »
(9-9/10)
Loading...