From 1e2b2b23eeda10ef1c2050647f186f37bc538c9b Mon Sep 17 00:00:00 2001 From: Igor Pecovnik Date: Sun, 12 Jan 2025 12:20:41 +0100 Subject: [PATCH] Add bridges networking to all existing bridges in the system --- tools/modules/software/module_cockpit.sh | 25 +++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/tools/modules/software/module_cockpit.sh b/tools/modules/software/module_cockpit.sh index 965cac46..ec28f9ba 100644 --- a/tools/modules/software/module_cockpit.sh +++ b/tools/modules/software/module_cockpit.sh @@ -48,17 +48,20 @@ function module_cockpit() { pkg_update pkg_install cockpit cockpit-ws cockpit-system cockpit-storaged cockpit-machines samba dnsmasq virtinst qemu-kvm qemu-utils # add bridged networking - cat <<- EOF > /etc/libvirt/kvm-hostbridge.xml - - hostbridge - - - - EOF - virsh net-define /etc/libvirt/kvm-hostbridge.xml - virsh net-start hostbridge - virsh net-autostart hostbridge - + for f in /sys/class/net/*; do + intf=$(basename $f) + if [[ $intf =~ ^br[0-9] ]]; then + cat <<- EOF > /etc/libvirt/kvm-hostbridge-${intf}.xml + + hostbridge-${intf} + + + + EOF + virsh net-define /etc/libvirt/kvm-hostbridge-${intf}.xml + virsh net-start hostbridge-${intf} + virsh net-autostart hostbridge-${intf} + done echo "Cockpit installed successfully." ;; "${commands[2]}")