From 867a10d0c53446f9a89e962cc233af113d663904 Mon Sep 17 00:00:00 2001
From: catborise <catborise@yahoo.com>
Date: Thu, 27 Dec 2018 16:17:51 +0300
Subject: [PATCH] Ubuntu 18.04 installation support added

---
 dev/libvirt-bootstrap.sh | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/dev/libvirt-bootstrap.sh b/dev/libvirt-bootstrap.sh
index 66eb6de..e3dd702 100644
--- a/dev/libvirt-bootstrap.sh
+++ b/dev/libvirt-bootstrap.sh
@@ -590,15 +590,23 @@ daemons_running_opensuse() {
 #
 install_ubuntu() {
     apt-get update || return 1
-    apt-get -y install kvm libvirt-bin bridge-utils sasl2-bin python-guestfs supervisor || return 1
+    if [ $DISTRO_MAJOR_VERSION -lt 18 ]; then
+       apt-get -y install kvm libvirt-bin bridge-utils sasl2-bin python-guestfs supervisor || return 1
+    else
+       apt install -y qemu-kvm libvirt-bin bridge-utils virt-manager sasl2-bin python-guestfs supervisor || return 1
+    fi
+
+
     return 0
 }
 
 install_ubuntu_post() {
     if [ -f /etc/default/libvirt-bin ]; then
         sed -i 's/libvirtd_opts="-d"/libvirtd_opts="-d -l"/g' /etc/default/libvirt-bin
+    elif [ -f /etc/default/libvirtd ]; then
+        sed -i 's/libvirtd_opts="-d"/libvirtd_opts="-d -l"/g' /etc/default/libvirtd
     else
-        echoerror "/etc/default/libvirt-bin not found. Exiting..."
+        echoerror "/etc/default/libvirt-bin or /etc/default/libvirtd not found. Exiting..."
         exit 1
     fi
     if [ -f /etc/libvirt/libvirtd.conf ]; then