mirror of
https://github.com/churchers/vm-bhyve.git
synced 2025-12-11 01:10:01 +01:00
31 lines
509 B
Bash
31 lines
509 B
Bash
#!/bin/sh
|
|
#
|
|
# $FreeBSD$
|
|
|
|
# PROVIDE: vm
|
|
# REQUIRE: NETWORKING SERVERS dmesg
|
|
# BEFORE: dnsmasq ipfw pf
|
|
# KEYWORD: shutdown nojailvnet
|
|
|
|
. /etc/rc.subr
|
|
|
|
: ${vm_enable="NO"}
|
|
|
|
name=vm
|
|
desc="Start and stop vm-bhyve guests on boot/shutdown"
|
|
rcvar=vm_enable
|
|
|
|
load_rc_config $name
|
|
|
|
command="/usr/local/sbin/${name}"
|
|
start_cmd="${name}_start"
|
|
stop_cmd="${command} stopall -f"
|
|
|
|
vm_start()
|
|
{
|
|
env rc_force="$rc_force" ${command} init
|
|
env rc_force="$rc_force" ${command} startall >/dev/null &
|
|
}
|
|
|
|
run_rc_command "$1"
|