Add a bhyverc script using pidfiles.
This commit is contained in:
37
ansible/roles/bhyve/files/bhyverc.sh
Normal file
37
ansible/roles/bhyve/files/bhyverc.sh
Normal file
@@ -0,0 +1,37 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# REQUIRE: LOGIN FILESYSTEMS
|
||||
# PROVIDE: bhyverc
|
||||
# KEYWORD: shutdown
|
||||
|
||||
. /etc/rc.subr
|
||||
name=bhyverc
|
||||
rcvar=${name}_enable
|
||||
start_cmd="${name}_start"
|
||||
stop_cmd="${name}_stop"
|
||||
status_cmd="${name}_status"
|
||||
console_cmd="${name}_console"
|
||||
extra_commands="console"
|
||||
load_rc_config $name
|
||||
|
||||
bhyverc_start() {
|
||||
export PATH="$PATH:/usr/local/bin"
|
||||
exec /usr/local/bin/bhyverc start "${@}"
|
||||
}
|
||||
|
||||
bhyverc_status() {
|
||||
export PATH="$PATH:/usr/local/bin"
|
||||
exec /usr/local/bin/bhyverc status "${@}"
|
||||
}
|
||||
|
||||
bhyverc_stop() {
|
||||
export PATH="$PATH:/usr/local/bin"
|
||||
exec /usr/local/bin/bhyverc stop "${@}"
|
||||
}
|
||||
|
||||
bhyverc_console() {
|
||||
export PATH="$PATH:/usr/local/bin"
|
||||
exec /usr/local/bin/bhyverc console "${@}"
|
||||
}
|
||||
|
||||
run_rc_command "$@"
|
||||
Reference in New Issue
Block a user