#!/bin/bash -e
# -*-mode: sh; tab-width: 8; coding: utf-8-unix -*-
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.

ROLE=proxy
MODE=gateway
CONN=guest

. /usr/local/etc/local.d/local.bash || exit 1

local_start_services qemu-guest-agent # spice-vdagent

if ! [ -e /dev/virtio-ports/org.qemu.guest_agent.0 ] ; then
    echo WARN: $prog /dev/virtio-ports/org.qemu.guest_agent.0 not found
    echo WARN: $prog Add  "<channel type='unix'><target type='virtio' name='org.qemu.guest_agent.0'/></channel>"
    echo 'WARN: to the /etc/libvirtd/qemu/*.xml file on the host'
fi

local_guest_config
local_guest_neutersystemd

local_guest_start_services qemu-guest-agent  # spice-vdagent
# local_guest_add_xorg_conf

local_guest_status
