Add mediamtx vm.
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
# BEFORE: netif
|
||||
|
||||
. /etc/rc.subr
|
||||
name=opnsense
|
||||
name=unifi
|
||||
rcvar=${name}_enable
|
||||
start_cmd="${name}_start"
|
||||
stop_cmd="${name}_stop"
|
||||
@@ -14,12 +14,12 @@ load_rc_config $name
|
||||
|
||||
tmux_name="unifi"
|
||||
|
||||
opnsense_start() {
|
||||
# /usr/local/bin/tmux new-session -d -s "$tmux_name" "/usr/bin/env VNC_ENABLE=YES VNC_LISTEN=0.0.0.0:5900 /usr/local/bin/bash /home/talexander/launch_opnsense.bash"
|
||||
/usr/local/bin/tmux new-session -d -s "$tmux_name" "/usr/bin/env VNC_ENABLE=NO VNC_LISTEN=0.0.0.0:5900 /usr/local/bin/bash /home/talexander/launch_unifi.bash"
|
||||
unifi_start() {
|
||||
/usr/local/bin/tmux new-session -d -s "$tmux_name" "/usr/bin/env VNC_ENABLE=YES VNC_LISTEN=0.0.0.0:5900 /usr/local/bin/bash /home/talexander/launch_unifi.bash"
|
||||
# /usr/local/bin/tmux new-session -d -s "$tmux_name" "/usr/bin/env VNC_ENABLE=NO VNC_LISTEN=0.0.0.0:5900 /usr/local/bin/bash /home/talexander/launch_unifi.bash"
|
||||
}
|
||||
|
||||
opnsense_status() {
|
||||
unifi_status() {
|
||||
if /usr/local/bin/tmux has-session -t $tmux_name 2>/dev/null; then
|
||||
echo "$tmux_name is running."
|
||||
else
|
||||
@@ -28,17 +28,17 @@ opnsense_status() {
|
||||
fi
|
||||
}
|
||||
|
||||
opnsense_stop() {
|
||||
unifi_stop() {
|
||||
/usr/local/bin/tmux has-session -t $tmux_name 2>/dev/null && (
|
||||
/usr/local/bin/tmux kill-session -t $tmux_name
|
||||
sleep 10
|
||||
bhyvectl --vm=unifi --destroy
|
||||
# kill `cat /var/run/opnsense.pid`
|
||||
# kill `cat /var/run/unifi.pid`
|
||||
)
|
||||
opnsense_wait_for_end
|
||||
unifi_wait_for_end
|
||||
}
|
||||
|
||||
opnsense_wait_for_end() {
|
||||
unifi_wait_for_end() {
|
||||
while /usr/local/bin/tmux has-session -t $tmux_name 2>dev/null; do
|
||||
sleep 1
|
||||
done
|
||||
|
||||
Reference in New Issue
Block a user